package com.aspose.cells;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;

final class zkr {
   static ArrayList a(zn var0, zbcq var1, com.aspose.cells.b.a.b.zp var2, float var3, double var4, int var6) throws Exception {
      zig var7 = var1.v();
      zbcs var8 = var7.z();
      int var9 = var8.getCount();
      int var13 = var1.ag();
      int var10;
      zbp var11;
      zbp var12;
      if (var13 == 1) {
         var12 = var7.e();
         var11 = var7.G();
         var10 = var8.e(1);
      } else {
         var12 = var7.g();
         var11 = var7.I();
         var10 = var8.e(2);
      }

      if (var12.k() == 2) {
         return a(var0, var1, var2, var3, var4);
      } else {
         double var14 = var11.n() ? var11.g(var11.z()) : var11.z();
         double var16 = var11.n() ? var11.g(var11.D()) : var11.D();
         var4 = var11.n() ? var11.g(var4) : var4;
         float var18 = 0.0F;
         float var19 = 1.5F;
         zbcq var20 = var7.z().d(var13);
         if (var20 != null) {
            var18 = (float)var20.L() / 100.0F;
            var19 = (float)var20.K() / 100.0F;
         }

         ArrayList var21 = new ArrayList();
         float var22 = 0.0F;
         int var23 = var6;
         if (var12.p) {
            var23 = (int)var12.z();
         }

         if (!var12.f() && !var7.u()) {
            var22 = (float)(var23 - 1);
            if (var22 == 0.0F) {
               var22 = 1.0F;
            }

            if (var12.u) {
               var22 += 0.5F;
            }
         } else {
            var22 = (float)var23;
         }

         double var24 = (double)var2.e() / (double)var22;
         int var26 = var8.a(var1, var13, new int[]{14});
         if (var26 == -1) {
            return var21;
         } else {
            int var27 = var1.aj();
            zjg var28 = var1.E();

            for(int var29 = 0; var29 < var28.getCount(); ++var29) {
               zje var30 = var28.b(var29);
               float var31 = (float)var24 / ((float)var10 - var18 * (float)(var10 - 1) + var19);
               float var32 = var31 * var18;
               float var33 = var31 * var19;
               float var34 = (float)var26 * (var31 - var32);
               float var35 = (float)var24 * (float)var29 + var33 / 2.0F + var34;
               if (!var12.f() && !var7.u()) {
                  var35 -= (float)(var24 / 2.0D);
               }

               if (var12.p()) {
                  var35 = (float)(var2.c() + var2.e()) - var35 - var31;
               } else {
                  var35 += (float)var2.c();
               }

               if (var30 != null && !var30.a()) {
                  double var36 = var30.v();
                  float var38 = (float)((var4 - var36) / (var14 - var16) * (double)var2.f());
                  if (var38 < 0.0F && var38 > -1.0F) {
                     var38 = -1.0F;
                  }

                  if (var38 > 0.0F && var38 < 1.0F) {
                     var38 = 1.0F;
                  }

                  boolean var39 = false;
                  if (var38 == 0.0F) {
                     var39 = true;
                  }

                  zsq var40 = var1.x();
                  if (var40 != null && var40.d() != 2) {
                     com.aspose.cells.b.a.b.zo var41 = new com.aspose.cells.b.a.b.zo(var35 + var31 / 2.0F, var3);
                     double var42 = 0.0D;
                     double var44 = 0.0D;
                     float var46 = 0.0F;
                     float var47 = 0.0F;
                     if (var40 != null) {
                        switch(var40.g()) {
                        case 0:
                           double var48 = var40.e().size() > var29 ? var40.a(var40.e().get(var29)) : 0.0D;
                           var42 = var48;
                           var48 = var40.f().size() > var29 ? var40.a(var40.f().get(var29)) : 0.0D;
                           var44 = var48;
                           break;
                        case 1:
                           var42 = var40.c();
                           var44 = var42;
                           break;
                        case 2:
                           var42 = var40.c() * var36 / 100.0D;
                           var44 = -var42;
                        }

                        var46 = (float)var42 / (float)(var14 - var16) * (float)var2.f();
                        var47 = (float)var44 / (float)(var14 - var16) * (float)var2.f();
                        if (!var11.p()) {
                           var41.b(var41.e() + var38);
                        } else {
                           var41.b(var41.e() - var38);
                        }
                     }

                     var40.a(var41, var46, var47);
                  }

                  float var50 = var3;
                  if (!var11.p()) {
                     if (var38 < 0.0F) {
                        var38 = -var38;
                        var50 = var3 - var38;
                     }
                  } else if (var38 < 0.0F) {
                     var38 = -var38;
                  } else {
                     var50 = var3 - var38;
                  }

                  com.aspose.cells.b.a.b.zq var51 = new com.aspose.cells.b.a.b.zq(var35, var50, var31, var38 + 1.0F);
                  com.aspose.cells.b.a.b.zq var43 = new com.aspose.cells.b.a.b.zq(var51.f(), var51.g(), var51.h(), var51.i());
                  if (var51.g() < (float)var2.d()) {
                     var51.d(var51.i() - ((float)var2.d() - var51.g()));
                     var51.b((float)var2.d());
                  }

                  if (var51.m() > (float)(var2.j() + 1)) {
                     var51.d(var51.i() - (var51.m() - (float)var2.j()));
                  }

                  if (var51.l() >= (float)var2.c() && var51.j() <= (float)var2.i()) {
                     if (var51.f() < (float)var2.c()) {
                        var51.c(var51.h() - ((float)var2.c() - var51.f()));
                        var51.a((float)var2.c());
                     } else if (var51.l() > (float)var2.i()) {
                        var51.c(var51.h() - (var51.l() - (float)var2.i()));
                     }

                     if (var51.h() + 1.0F >= (var31 - 1.0F) / 3.0F) {
                        if (!var39) {
                           a(var0, var30, var51, var3, var11, var2);
                        }

                        Object[] var52 = new Object[5];
                        boolean var45;
                        if (var43.g() + (var43.i() - 1.0F) / 2.0F < var3) {
                           var45 = true;
                        } else if (var36 != 0.0D) {
                           var45 = false;
                        } else if (var11.p()) {
                           var45 = false;
                        } else {
                           var45 = true;
                        }

                        var52[0] = var27;
                        var52[1] = var29;
                        var52[2] = var43;
                        var52[3] = var12;
                        var52[4] = var45;
                        com.aspose.cells.b.a.a.ze.a(var21, (Object)var52);
                     }
                  }
               }
            }

            return var21;
         }
      }
   }

   private static void a(zn var0, zix var1, com.aspose.cells.b.a.b.zq var2) {
      var1.c().a(var2);
      if (var1.d().g()) {
         if (var2.h() > (float)var1.d().h() / 2.0F) {
            var2.c(var2.h() - (float)var1.d().h() / 2.0F);
         }

         if (var2.i() < 1.0F) {
            var2.d(1.0F);
         }

         var1.d().a(var2);
      }

   }

   private static ArrayList a(zn var0, zbcq var1, com.aspose.cells.b.a.b.zp var2, float var3, double var4) throws Exception {
      zig var6 = var1.v();
      int var7 = var6.z().getCount();
      zbcs var8 = var6.z();
      int var10 = var1.ag();
      float var11 = 0.0F;
      float var12 = 1.5F;
      zbcq var13 = var6.z().d(var10);
      if (var13 != null) {
         var11 = (float)var13.L() / 100.0F;
         var12 = (float)var13.K() / 100.0F;
      }

      int var9;
      zbp var14;
      zbp var15;
      ArrayList var16;
      if (var10 == 1) {
         var14 = var6.e();
         var15 = var6.G();
         var9 = var8.e(1);
         var16 = zia.a(var6.z().c(), var6.X());
      } else {
         var14 = var6.g();
         var15 = var6.I();
         var9 = var8.e(2);
         var16 = zia.a(var6.z().d(), var6.X());
      }

      double var17 = var15.n() ? var15.g(var15.z()) : var15.z();
      double var19 = var15.n() ? var15.g(var15.D()) : var15.D();
      var4 = var15.n() ? var15.g(var4) : var4;
      ArrayList var21 = new ArrayList();
      int var22 = var16.size();
      int var23 = var14.j();
      int var24 = (int)var14.D();
      int var25 = (int)var14.z();
      float var26 = 0.0F;
      if (!var14.f() && !var6.u()) {
         var26 = (float)zbr.a(var23, var25, var24, var6.X());
         if (var26 == 0.0F) {
            var26 = 1.0F;
         }

         if (var14.u) {
            var26 += 0.5F;
         }
      } else {
         var26 = (float)(zbr.a(var23, var25, var24, var6.X()) + 1);
      }

      double var27 = (double)var2.e() / (double)var26;

      for(int var29 = 0; var29 < var22; ++var29) {
         zje var30 = var1.E().b(var29);
         float var31 = (float)(var27 / (double)((float)var9 - var11 * (float)(var9 - 1) + var12));
         float var32 = var31 * var11;
         float var33 = var31 * var12;
         int var34 = com.aspose.cells.b.a.zo.a(com.aspose.cells.b.a.zr.a(var16.get(var29)));
         var34 = zbr.a(var23, var34, var6.X());
         int var35 = zbr.a(var23, var34, var24, var6.X());
         float var36 = (float)(var27 * (double)var35);
         if (!var14.f() && !var6.u()) {
            var36 -= (float)(var27 / 2.0D);
         }

         float var37 = 0.0F;
         if (var14.p()) {
            var37 = (float)(var2.c() + var2.e()) - var36 - var33 / 2.0F - var31 - 1.0F;
         } else {
            var37 = (float)var2.c() + var36 + var33 / 2.0F + 1.0F;
         }

         int var38 = var8.a(var1, var10, new int[]{14});
         if (var38 == -1) {
            return var21;
         }

         int var39 = var1.aj();
         if (var14.p()) {
            var37 -= (float)var38 * (var31 - var32);
         } else {
            var37 += (float)var38 * (var31 - var32);
         }

         if (var30 != null && !var30.a()) {
            double var40 = var30.v();
            float var42 = (float)((var4 - var40) / (var17 - var19) * (double)var2.f());
            if (var42 < 0.0F && var42 > -1.0F) {
               var42 = -1.0F;
            }

            if (var42 > 0.0F && var42 < 1.0F) {
               var42 = 1.0F;
            }

            boolean var43 = false;
            if (var42 == 0.0F) {
               var43 = true;
            }

            zsq var44 = var1.x();
            if (var44 != null && var44.d() != 2) {
               com.aspose.cells.b.a.b.zo var45 = new com.aspose.cells.b.a.b.zo(var37 + var31 / 2.0F, var3);
               double var46 = 0.0D;
               double var48 = 0.0D;
               float var50 = 0.0F;
               float var51 = 0.0F;
               if (var44 != null) {
                  switch(var44.g()) {
                  case 0:
                     double var52 = var44.e().size() > var29 ? var44.a(var44.e().get(var29)) : 0.0D;
                     var46 = var52;
                     var52 = var44.f().size() > var29 ? var44.a(var44.f().get(var29)) : 0.0D;
                     var48 = var52;
                     break;
                  case 1:
                     var46 = var44.c();
                     var48 = var46;
                     break;
                  case 2:
                     var46 = var44.c() * var40 / 100.0D;
                     var48 = -var46;
                  }

                  var50 = (float)var46 / (float)(var17 - var19) * (float)var2.f();
                  var51 = (float)var48 / (float)(var17 - var19) * (float)var2.f();
                  if (!var15.p()) {
                     var45.b(var45.e() + var42);
                  } else {
                     var45.b(var45.e() - var42);
                  }
               }

               var44.a(var45, var50, var51);
            }

            float var54 = var3;
            if (!var15.p()) {
               if (var42 < 0.0F) {
                  var42 = -var42;
                  var54 = var3 - var42;
               }
            } else if (var42 < 0.0F) {
               var42 = -var42;
            } else {
               var54 = var3 - var42;
            }

            com.aspose.cells.b.a.b.zq var55 = new com.aspose.cells.b.a.b.zq(var37, var54, var31, var42 + 1.0F);
            com.aspose.cells.b.a.b.zq var47 = new com.aspose.cells.b.a.b.zq(var55.f(), var55.g(), var55.h(), var55.i());
            if (var55.g() < (float)var2.d()) {
               var55.d(var55.i() - ((float)var2.d() - var55.g()));
               var55.b((float)var2.d());
            }

            if (var55.m() > (float)(var2.j() + 1)) {
               var55.d(var55.i() - (var55.m() - (float)var2.j()));
            }

            if (var55.l() >= (float)var2.c() && var55.j() <= (float)var2.i()) {
               if (var55.f() < (float)var2.c()) {
                  var55.c(var55.h() - ((float)var2.c() - var55.f()));
                  var55.a((float)var2.c());
               } else if (var55.l() > (float)var2.i()) {
                  var55.c(var55.h() - (var55.l() - (float)var2.i()));
               }

               if (var55.h() + 1.0F >= (var31 - 1.0F) / 3.0F) {
                  if (!var43) {
                     a(var0, var30, var55, var3, var15, var2);
                  }

                  Object[] var56 = new Object[5];
                  boolean var49;
                  if (var55.g() < var3) {
                     var49 = true;
                  } else if (var40 != 0.0D) {
                     var49 = false;
                  } else if (var15.p()) {
                     var49 = false;
                  } else {
                     var49 = true;
                  }

                  var56[0] = var39;
                  var56[1] = var29;
                  var56[2] = var47;
                  var56[3] = var14;
                  var56[4] = var49;
                  com.aspose.cells.b.a.a.ze.a(var21, (Object)var56);
               }
            }
         }
      }

      return var21;
   }

   private static void a(zn var0, zje var1, com.aspose.cells.b.a.b.zq var2, float var3, zbp var4, com.aspose.cells.b.a.b.zp var5) {
      com.aspose.cells.b.a.b.zp var6 = new com.aspose.cells.b.a.b.zp(var5.c(), var5.d(), var5.e(), var5.f());
      var6.a(1, 1);
      com.aspose.cells.b.a.b.a.zf var7 = var0.e();
      var0.a(var6);
      if (var1.i().h() != 0 || var1.k().g()) {
         var1.a(new com.aspose.cells.b.a.b.zq(var2.f(), var2.g(), var2.h(), var2.i()));
      }

      a(var1);
      if (var1.i().h() != 0) {
         if (var2.m() > (float)var5.j() && !var1.k().m()) {
            var2.d(var2.i() - (var2.m() - (float)var5.j()));
         }

         if (var1.i().g() && var1.i().e().f() == 4) {
            var1.i().e().c().j(var1.v());
         }

         var1.i().a(var2);
      }

      var1.k().a(var2);
      var0.a(var7);
   }

   static void a(zje var0) {
      zat var1 = var0.i();
      zalw var2 = var0.k();
      boolean var3 = var1.k();
      if (var3 && !var1.g() && var1.h() != 0) {
         if (var0.h().R() <= 16) {
            if (var1.c().isEmpty()) {
               var1.a(Color.getWhite());
            }

            if (var2.c() != 3) {
               var2.a(Color.getBlack());
            }
         } else {
            var1.a(var1.f());
         }
      }

   }

   static void a(zn var0, zig var1, ArrayList var2) throws Exception {
      for(int var3 = 0; var3 < var2.size(); ++var3) {
         Object[] var4 = (Object[])((Object[])var2.get(var3));
         int var5 = (Integer)var4[0];
         int var6 = (Integer)var4[1];
         com.aspose.cells.b.a.b.zq var7 = (com.aspose.cells.b.a.b.zq)var4[2];
         zbp var8 = (zbp)var4[3];
         boolean var9 = (Boolean)var4[4];
         int var10 = (int)((float)var1.a() * 0.2F);
         a(var0, var8, var5, var6, var7, var9, var10);
      }

   }

   private static void a(zn var0, zbp var1, int var2, int var3, com.aspose.cells.b.a.b.zq var4, boolean var5, int var6) throws Exception {
      zbcs var7 = var1.e().z();
      var7.c(var2);
      zje var9 = var7.c(var2).E().b(var3);
      zpu var10 = var9.o();
      com.aspose.cells.b.a.b.zt var11 = zpw.a(var0, var1, var7, var2, var3, var6);
      float var12 = var4.f() + var4.h() / 2.0F - var11.b() / 2.0F;
      float var13 = 0.0F;
      boolean var14 = false;
      boolean var15 = false;
      int var16 = var10.j();
      if (var16 == 9) {
         var16 = zpw.b(var7.c(var2).m());
      }

      byte var20;
      byte var22;
      switch(var16) {
      case 1:
         var13 = var4.g() + var4.i() / 2.0F - var11.c() / 2.0F;
         break;
      case 2:
         if (var5) {
            var13 = var4.g() + var4.i() - var11.c();
            var20 = -1;
            var13 += (float)var20;
         } else {
            var13 = var4.g();
            var22 = 5;
            var13 += (float)var22;
         }
         break;
      case 3:
         if (var5) {
            var13 = var4.g();
            byte var19 = 5;
            var13 += (float)var19;
         } else {
            var13 = var4.g() + var4.i() - var11.c();
            byte var21 = -1;
            var13 += (float)var21;
         }
         break;
      default:
         if (var5) {
            var13 = var4.g() - var11.c();
            var20 = -1;
            var13 += (float)var20;
         } else {
            var13 = var4.g() + var4.i();
            var22 = 5;
            var13 += (float)var22;
         }
      }

      if (var7.c(var2).a(new int[]{14})) {
         if (var5) {
            if (var13 + (float)zpw.a + var11.c() > var4.m()) {
               var13 -= var13 + (float)zpw.a + var11.c() - var4.m();
            }
         } else if (var13 < var4.g()) {
            var13 += var4.g() - var13;
         }
      }

      var10.a().b = new com.aspose.cells.b.a.b.zp(zbuk.c((double)var12), zbuk.c((double)var13), zbuk.a((double)var11.b()), zbuk.a((double)var11.c()));
      var10.a().z();
      boolean var17 = false;
      com.aspose.cells.b.a.b.zo var18 = new com.aspose.cells.b.a.b.zo((float)(var10.a().a.c() + var10.a().a.e()), (float)(var10.a().a.d() + var10.a().a.f()));
      if (var18.d() < 0.0F || var18.d() > (float)var1.e().a() || var18.e() < 0.0F || var18.e() > (float)var1.e().b()) {
         var17 = true;
      }

      if (!var17) {
         zpw.a(var0, var1, var7, var2, var3, var10.a().a);
      }

   }

   static void a(zn var0, zbcq var1, ArrayList var2, com.aspose.cells.b.a.b.zp var3) {
      com.aspose.cells.b.a.b.a.zf var4 = var0.e();
      com.aspose.cells.b.a.b.zq var5 = var0.f();
      var0.a(var3);
      var0.a(4);

      com.aspose.cells.b.a.b.zo var7;
      zje var8;
      for(int var6 = 0; var6 < var2.size(); ++var6) {
         if (var2.get(var6) != null) {
            var7 = (com.aspose.cells.b.a.b.zo)var2.get(var6);
            var8 = var1.E().b(var6);
            if (var8 != null) {
               var8.a(new com.aspose.cells.b.a.b.zq(var7.d(), var7.e(), 0.0F, 0.0F));
            }

            if (a(new com.aspose.cells.b.a.b.zo(var7.d() / 10.0F, var7.e() / 10.0F), var5)) {
               var2.set(var6, (Object)null);
            }
         }
      }

      com.aspose.cells.b.a.b.zo var14;
      ArrayList var15;
      int var19;
      if (var1.F()) {
         if (var2.size() > 1) {
            var15 = new ArrayList();
            ArrayList var16 = new ArrayList();
            var8 = null;
            zje var9 = null;
            boolean var10 = false;

            zje var12;
            for(int var11 = 0; var11 < var2.size(); ++var11) {
               var12 = var1.E().b(var11);
               if (var12 == null || !var12.d() && !var12.e() && !var12.c()) {
                  Object var18 = var2.get(var11);
                  var9 = var12;
                  if (var18 != null) {
                     com.aspose.cells.b.a.a.ze.a(var15, var18);
                     com.aspose.cells.b.a.a.ze.a(var16, var18);
                  }

                  var19 = var11 + 1;
                  break;
               }
            }

            for(var19 = 1; var19 < var2.size(); ++var19) {
               Object var20 = var2.get(var19);
               var12 = var1.E().b(var19);
               if (var19 == var2.size() - 1 && (var1.m() == 57 || var1.m() == 58)) {
                  var12 = var1.E().b(0);
               }

               if (var12 != null && var20 != null) {
                  if (var12 == null || !var12.d() && !var12.e() && !var12.c()) {
                     if (var12 != null && var20 != null) {
                        com.aspose.cells.b.a.b.zo var13;
                        if (!var9.k().b(var12.k()) && var15.size() > 1) {
                           a(var0, var9, var15, var16, var3);
                           var9 = var12;
                           var13 = (com.aspose.cells.b.a.b.zo)var15.get(var15.size() - 1);
                           var15.clear();
                           if (var20 != null) {
                              com.aspose.cells.b.a.a.ze.a(var15, (Object)var13);
                              com.aspose.cells.b.a.a.ze.a(var15, var20);
                              com.aspose.cells.b.a.a.ze.a(var16, var20);
                              continue;
                           }
                        }

                        if (var20 != null) {
                           var13 = (com.aspose.cells.b.a.b.zo)var2.get(var19);
                           if (var15.size() > 1) {
                              var14 = (com.aspose.cells.b.a.b.zo)var15.get(var15.size() - 1);
                              if (Math.abs(var14.d() - var13.d()) < 0.5F && Math.abs(var14.e() - var13.e()) < 0.5F) {
                                 a(var0, var9, var15, var16, var3);
                                 var15.clear();
                                 var16.clear();
                              }
                           }

                           com.aspose.cells.b.a.a.ze.a(var15, var20);
                           com.aspose.cells.b.a.a.ze.a(var16, var20);
                        }

                        var9 = var12;
                     } else {
                        if (var15.size() > 1) {
                           a(var0, var9, var15, var16, var3);
                        }

                        var15.clear();
                        var16.clear();
                        var9 = var12;
                     }
                  }
               } else {
                  if (var15.size() > 1) {
                     a(var0, var9, var15, var16, var3);
                  }

                  var15.clear();
                  var16.clear();
               }
            }

            if (var15.size() > 1) {
               a(var0, var9, var15, var16, var3);
            }
         }
      } else if (var2.size() > 1) {
         var15 = new ArrayList();
         var7 = null;
         var8 = null;
         boolean var23 = false;

         zje var21;
         int var24;
         for(var19 = 0; var19 < var2.size(); ++var19) {
            var21 = var1.E().b(var19);
            if (var21 == null || !var21.d() && !var21.e() && !var21.c()) {
               Object var17 = var2.get(var19);
               if (var17 == null || ((com.aspose.cells.b.a.b.zo)var17).d() >= 0.0F) {
                  var8 = var21;
                  if (var17 != null) {
                     com.aspose.cells.b.a.a.ze.a(var15, var17);
                  }

                  var24 = var19 + 1;
                  break;
               }
            }
         }

         for(var24 = 1; var24 < var2.size(); ++var24) {
            Object var22 = var2.get(var24);
            var21 = var1.E().b(var24);
            if (var24 == var2.size() - 1 && (var1.m() == 57 || var1.m() == 58)) {
               var21 = var1.E().b(0);
            }

            if ((var21 == null || !var21.d() && !var21.e() && !var21.c()) && (var22 == null || ((com.aspose.cells.b.a.b.zo)var22).d() >= 0.0F)) {
               com.aspose.cells.b.a.b.zo[] var26;
               if (var21 != null && var22 != null) {
                  if (!var8.k().a(var21.k()) && var15.size() > 1) {
                     new com.aspose.cells.b.a.b.a.ze();
                     var26 = a((List)var15);
                     a(var0, var26, var8);
                     var8 = var21;
                     var14 = (com.aspose.cells.b.a.b.zo)var15.get(var15.size() - 1);
                     var15.clear();
                     if (var22 != null) {
                        com.aspose.cells.b.a.a.ze.a(var15, (Object)var14);
                        com.aspose.cells.b.a.a.ze.a(var15, var22);
                        continue;
                     }
                  }

                  if (var22 != null) {
                     com.aspose.cells.b.a.a.ze.a(var15, var22);
                  }

                  var8 = var21;
               } else {
                  if (var15.size() > 1) {
                     new com.aspose.cells.b.a.b.a.ze();
                     var26 = a((List)var15);
                     a(var0, var26, var8);
                  }

                  var15.clear();
                  var8 = var21;
               }
            }
         }

         if (var15.size() > 1) {
            new com.aspose.cells.b.a.b.a.ze();
            com.aspose.cells.b.a.b.zo[] var25 = a((List)var15);
            a(var0, var25, var8);
         }
      }

      var0.a(var4);
   }

   private static double a(com.aspose.cells.b.a.b.zo var0, com.aspose.cells.b.a.b.zo var1, com.aspose.cells.b.a.b.zo var2) {
      double var3 = Math.sqrt(Math.pow((double)(var1.e() - var0.e()), 2.0D) + Math.pow((double)(var1.d() - var0.d()), 2.0D));
      double var5 = Math.sqrt(Math.pow((double)(var2.e() - var1.e()), 2.0D) + Math.pow((double)(var2.d() - var1.d()), 2.0D));
      double var7 = Math.sqrt(Math.pow((double)(var2.e() - var0.e()), 2.0D) + Math.pow((double)(var2.d() - var0.d()), 2.0D));
      double var9 = (Math.pow(var3, 2.0D) + Math.pow(var5, 2.0D) - Math.pow(var7, 2.0D)) / (2.0D * var3 * var5);
      return Math.acos(var9);
   }

   private static void a(zn var0, com.aspose.cells.b.a.b.zo[] var1, zje var2) {
      if (var1.length < 3) {
         var2.k().a(var1[0], var1[1]);
      } else {
         com.aspose.cells.b.a.b.zo[][] var3 = new com.aspose.cells.b.a.b.zo[][]{var1};
         a(var3);
         var1 = var3[0];
         ArrayList var4 = new ArrayList();
         com.aspose.cells.b.a.b.zo var5 = var1[0];
         com.aspose.cells.b.a.b.zo var6 = var1[1];
         com.aspose.cells.b.a.a.ze.a(var4, (Object)var5);
         com.aspose.cells.b.a.a.ze.a(var4, (Object)var6);

         for(int var7 = 2; var7 < var1.length; ++var7) {
            com.aspose.cells.b.a.b.zo var8 = var1[var7];
            double var9 = a(var5, var6, var8);
            var9 = var9 * 180.0D / 3.141592653589793D;
            if (var2.l().c() == 2 && (var2.l().a().getA() & 255) != 255) {
               com.aspose.cells.b.a.a.ze.a(var4, (Object)var8);
               var5 = var6;
               var6 = var8;
            } else if (var9 < 30.0D) {
               a(var0, var4, var2);
               var2.k().a(var6, var8);
               var5 = var6;
               var6 = var8;
               var4.clear();
               com.aspose.cells.b.a.a.ze.a(var4, (Object)var5);
               com.aspose.cells.b.a.a.ze.a(var4, (Object)var8);
            } else {
               com.aspose.cells.b.a.a.ze.a(var4, (Object)var8);
               var5 = var6;
               var6 = var8;
            }
         }

         if (var4.size() > 1) {
            a(var0, var4, var2);
         }
      }

   }

   private static void a(zn var0, ArrayList var1, zje var2) {
      if (var1.size() == 2) {
         var2.k().a((com.aspose.cells.b.a.b.zo)var1.get(0), (com.aspose.cells.b.a.b.zo)var1.get(1));
      } else {
         com.aspose.cells.b.a.b.a.ze var3 = new com.aspose.cells.b.a.b.a.ze();
         com.aspose.cells.b.a.b.zo[] var4 = a((List)var1);
         var3.a(var4);
         com.aspose.cells.b.a.b.a.ze var5 = new com.aspose.cells.b.a.b.a.ze();
         var5.a(var4);
         com.aspose.cells.b.a.b.zm var6 = var2.k().b(var5);
         if (var2.l().c() == 2 && (var2.l().a().getA() & 255) != 255) {
            com.aspose.cells.b.a.b.zq var7 = com.aspose.cells.a.c.zn.a(var3);
            com.aspose.cells.b.a.b.zq var8 = var0.f();
            var7.a((float)((int)(var6.p() / 2.0F + 0.5F)), (float)((int)(var6.p() / 2.0F + 0.5F)));
         }

         var2.k().a(var3);
         var6.a();
         var5.g();
         var3.g();
      }

   }

   private static void a(com.aspose.cells.b.a.b.zo[][] var0) {
      com.aspose.cells.b.a.b.zo var1 = com.aspose.cells.b.a.b.zo.a();
      if (var0[0].length > 0) {
         var1 = var0[0][0];
      }

      int var2 = 0;

      for(int var3 = 1; var3 < var0[0].length; ++var3) {
         com.aspose.cells.b.a.b.zo var4 = var0[0][var3];
         if (var0[0].length - var2 <= 2) {
            break;
         }

         if (Math.abs(var1.d() - var4.d()) < 1.0F && Math.abs(var1.e() - var4.e()) < 1.0F) {
            var0[0][var3] = com.aspose.cells.b.a.b.zo.a();
            ++var2;
         } else {
            var1 = var0[0][var3];
         }
      }

      if (var2 > 0) {
         com.aspose.cells.b.a.b.zo[] var6 = new com.aspose.cells.b.a.b.zo[var0[0].length - var2];
         int var7 = 0;

         for(int var5 = 0; var5 < var0[0].length; ++var5) {
            if (!var0[0][var5].b()) {
               var6[var7] = var0[0][var5];
               ++var7;
            }
         }

         var0[0] = var6;
      }

   }

   static com.aspose.cells.b.a.b.zo[] a(List var0) {
      com.aspose.cells.b.a.b.zo[] var1 = new com.aspose.cells.b.a.b.zo[var0.size()];
      zbuk.a(var1);

      for(int var2 = 0; var2 < var0.size(); ++var2) {
         var1[var2] = (com.aspose.cells.b.a.b.zo)var0.get(var2);
      }

      return var1;
   }

   private static void a(zn var0, zje var1, ArrayList var2, ArrayList var3, com.aspose.cells.b.a.b.zp var4) {
      com.aspose.cells.b.a.b.zm var5 = null;
      com.aspose.cells.b.a.b.a.ze var6 = new com.aspose.cells.b.a.b.a.ze();
      com.aspose.cells.b.a.b.zo[] var7 = a((List)var3);
      if (var7.length > 1) {
         var6.c(var7);
         var5 = var1.k().b(var6);
         float var8 = 0.3F;
         float var9 = 0.5F;
         byte var10 = 3;
         int var11 = var3.size() - var2.size();
         int var12 = var2.size() - 1;
         if (var2.size() < var10) {
            var0.a(var5, var7, var11, var12, var9);
         } else {
            ArrayList var13 = new ArrayList();
            boolean var14 = false;
            boolean var15 = false;

            for(int var16 = 0; var16 < var2.size(); ++var16) {
               com.aspose.cells.b.a.b.zo var17 = (com.aspose.cells.b.a.b.zo)var2.get(var16);
               com.aspose.cells.b.a.b.zo var18;
               if (var16 > 0) {
                  var18 = (com.aspose.cells.b.a.b.zo)var2.get(var16 - 1);
                  if (Math.abs(var17.d() - var18.d()) < 0.5F && Math.abs(var17.e() - var18.e()) < 0.5F) {
                     continue;
                  }
               }

               com.aspose.cells.b.a.a.ze.a(var13, (Object)var17);
               if (var13.size() >= 3) {
                  var18 = (com.aspose.cells.b.a.b.zo)var13.get(var13.size() - 3);
                  com.aspose.cells.b.a.b.zo var19 = (com.aspose.cells.b.a.b.zo)var13.get(var13.size() - 2);
                  float var20 = (var19.e() - var18.e()) / (var19.d() - var18.d());
                  float var21 = (var17.e() - var19.e()) / (var17.d() - var19.d());
                  float var22 = var19.e() - var18.e();
                  float var23 = var17.e() - var19.e();
                  double var24 = (double)Math.abs(Math.abs(var21) - Math.abs(var20));
                  if (Math.abs(var21) < 2.0F || var23 / var22 < 8.0F) {
                     continue;
                  }
               }

               boolean var26 = a(var17, var4);
               if (var26) {
                  if (var15) {
                     int var27 = var13.size() - 1 - 1;
                     ++var16;

                     while(var16 < var2.size()) {
                        com.aspose.cells.b.a.b.zo var28 = (com.aspose.cells.b.a.b.zo)var2.get(var16);
                        boolean var29 = a(var28, var4);
                        if (!var29) {
                           break;
                        }

                        com.aspose.cells.b.a.a.ze.a(var13, (Object)var28);
                        ++var16;
                     }

                     --var16;
                     if (var13.size() != 2 && var27 != 0) {
                        if (var13.size() > 2) {
                           var11 += var13.size() - 1;
                           var12 -= var13.size() - 1;
                           var0.a(var5, a(var13, 0, var27), var9);
                           a(var0, var5, a(var13, var27, var13.size() - 1), var8);
                           var13.clear();
                           com.aspose.cells.b.a.a.ze.a(var13, (Object)var17);
                           var14 = false;
                           var15 = false;
                        }
                     } else {
                        var11 += var13.size() - 1;
                        var12 -= var13.size() - 1;
                        a(var0, var5, a((List)var13), var8);
                        var13.clear();
                        com.aspose.cells.b.a.a.ze.a(var13, (Object)var17);
                        var14 = false;
                        var15 = false;
                     }
                  }
               } else if (var14) {
                  var11 += var13.size() - 1;
                  var12 -= var13.size() - 1;
                  a(var0, var5, a((List)var13), var8);
                  var13.clear();
                  com.aspose.cells.b.a.a.ze.a(var13, (Object)var17);
                  var14 = false;
                  var15 = false;
               }

               if (var26) {
                  var14 = true;
               } else {
                  var15 = true;
               }
            }

            if (var13.size() > 1) {
               if (var14) {
                  a(var0, var5, var7, var11, var12, var8);
               } else {
                  var0.a(var5, var7, var11, var12, var9);
               }
            }
         }

         if (var5 != null) {
            var5.a();
         }

      }
   }

   private static void a(zn var0, com.aspose.cells.b.a.b.zm var1, com.aspose.cells.b.a.b.zo[] var2, float var3) {
      a(var0, var1, var2, 0, var2.length - 1, var3);
   }

   private static void a(zn var0, com.aspose.cells.b.a.b.zm var1, com.aspose.cells.b.a.b.zo[] var2, int var3, int var4, float var5) {
      float var6 = 0.0F;
      float var7 = 0.0F;
      float var8 = 0.0F;
      float var9 = 0.0F;

      int var10;
      for(var10 = 0; var10 < var2.length; ++var10) {
         if (var10 == 0) {
            var6 = var2[var10].d();
            var7 = var6;
            var8 = var2[var10].e();
            var9 = var8;
         } else {
            if (var2[var10].d() < var6) {
               var6 = var2[var10].d();
            }

            if (var2[var10].d() > var7) {
               var7 = var2[var10].d();
            }

            if (var2[var10].e() < var8) {
               var8 = var2[var10].e();
            }

            if (var2[var10].e() > var9) {
               var9 = var2[var10].e();
            }
         }
      }

      var10 = zbuk.h((double)(var7 - var6));
      int var11 = zbuk.h((double)(var9 - var8));
      int var12 = var10 > var11 ? var10 : var11;
      if (var12 > 4) {
         var5 *= (float)Math.pow(10.0D, (double)(4 - var12));
      }

      var0.a(var1, var2, var3, var4, var5);
   }

   private static com.aspose.cells.b.a.b.zo[] a(List var0, int var1, int var2) {
      com.aspose.cells.b.a.b.zo[] var3 = new com.aspose.cells.b.a.b.zo[var2 - var1 + 1];
      zbuk.a(var3);

      for(int var4 = var1; var4 <= var2; ++var4) {
         var3[var4 - var1] = (com.aspose.cells.b.a.b.zo)var0.get(var4);
      }

      return var3;
   }

   private static boolean a(com.aspose.cells.b.a.b.zo var0, com.aspose.cells.b.a.b.zp var1) {
      com.aspose.cells.b.a.b.zq var2 = new com.aspose.cells.b.a.b.zq((float)var1.c(), (float)var1.d(), (float)var1.e(), (float)var1.f());
      return a(var0, var2);
   }

   private static boolean a(com.aspose.cells.b.a.b.zo var0, com.aspose.cells.b.a.b.zq var1) {
      return var0.d() < var1.f() | var0.d() > var1.l() || var0.e() < var1.g() || var0.e() > var1.m();
   }

   static ArrayList b(zn var0, zbcq var1, com.aspose.cells.b.a.b.zp var2, float var3, double var4, int var6) throws Exception {
      zig var7 = var1.v();
      int[] var8 = new int[]{37, 40};
      int var11 = var1.ag();
      zbp var9;
      zbp var10;
      if (var11 == 1) {
         var10 = var7.e();
         var9 = var7.G();
      } else {
         var10 = var7.g();
         var9 = var7.I();
      }

      if (var10.k() == 2) {
         return b(var0, var1, var2, var3, var4);
      } else {
         zbcs var12 = var7.z();
         int var13 = var12.getCount();
         float var14 = (float)var1.K() / 100.0F;
         double var15 = var9.n() ? var9.g(var9.z()) : var9.z();
         double var17 = var9.n() ? var9.g(var9.D()) : var9.D();
         var4 = var9.n() ? var9.g(var4) : var4;
         boolean var19 = var1.M();
         zalw var20 = var1.P();
         zalw var21 = var1.Q();
         zix var22 = var1.T();
         zix var23 = var1.U();
         ArrayList var24 = new ArrayList();
         float var25 = 0.0F;
         int var26 = var6;
         if (var10.p) {
            var26 = (int)var10.z();
         }

         if (!var10.f() && !var7.u()) {
            var25 = (float)(var26 - 1);
            if (var25 == 0.0F) {
               var25 = 1.0F;
            }

            if (var10.u) {
               var25 += 0.5F;
            }
         } else {
            var25 = (float)var26;
         }

         double var27 = (double)var2.e() / (double)var25;
         ArrayList var29 = new ArrayList();
         ArrayList var30 = new ArrayList();
         List var31 = var12.a(var11, var8);

         int var32;
         for(var32 = 0; var32 < var31.size(); ++var32) {
            zbcq var33 = (zbcq)var31.get(var32);
            if ((!var7.an() || var33.equals(var1)) && (var1.O() || var1.N() || var33.equals(var1))) {
               var12.a(var33, var11, var8);
               int var35 = var33.aj();
               ArrayList var36 = new ArrayList();
               zjg var37 = var33.E();

               for(int var38 = 0; var38 < var6; ++var38) {
                  zje var39 = var37.b(var38);
                  if (var39 != null && !var39.a()) {
                     double var40 = (double)((float)var27 * (float)var38 + 1.0F);
                     if (var10.f() || var7.u()) {
                        var40 += (double)((float)(var27 / 2.0D));
                     }

                     if (var10.p()) {
                        var40 = (double)(var2.c() + var2.e()) - var40;
                     } else {
                        var40 += (double)var2.c();
                     }

                     double var42 = (double)var3;
                     double var44 = var39.v();
                     double var46 = (var44 - var4) / (var15 - var17) * (double)var2.f();
                     zsq var48 = var1.x();
                     com.aspose.cells.b.a.b.zo var49;
                     if (var48 != null && var33.equals(var1) && var48.d() != 2) {
                        var49 = new com.aspose.cells.b.a.b.zo((float)var40, var3);
                        double var50 = 0.0D;
                        double var52 = 0.0D;
                        float var54 = 0.0F;
                        float var55 = 0.0F;
                        switch(var48.g()) {
                        case 0:
                           double var56 = var48.e().size() > var38 ? var48.a(var48.e().get(var38)) : 0.0D;
                           var50 = var56;
                           var56 = var48.f().size() > var38 ? var48.a(var48.f().get(var38)) : 0.0D;
                           var52 = var56;
                           break;
                        case 1:
                           var50 = var48.c();
                           var52 = var50;
                           break;
                        case 2:
                           var50 = var48.c() * var44 / 100.0D;
                           var52 = -var50;
                        }

                        var54 = (float)var50 / (float)(var15 - var17) * (float)var2.f();
                        var55 = (float)var52 / (float)(var15 - var17) * (float)var2.f();
                        if (!var9.p()) {
                           var49.b(var49.e() - (float)var46);
                        } else {
                           var49.b(var49.e() + (float)var46);
                        }

                        var48.a(var49, var54, var55);
                     }

                     if (!var9.p()) {
                        var42 -= var46;
                     } else {
                        var42 += var46;
                     }

                     var49 = new com.aspose.cells.b.a.b.zo((float)var40, (float)var42);
                     com.aspose.cells.b.a.a.ze.a(var36, (Object)var49);
                     if (var33.equals(var1)) {
                        if (var19) {
                           var20.a((float)var40, (float)var42, (float)var40, var3);
                        }

                        com.aspose.cells.b.a.a.ze.a(var30, (Object)var49);
                        Object[] var68 = new Object[]{var35, var38, var49, var10};
                        if (!var39.e()) {
                           com.aspose.cells.b.a.a.ze.a(var24, (Object)var68);
                        }
                     }
                  } else {
                     com.aspose.cells.b.a.a.ze.a(var36, (Object)null);
                     if (var33.equals(var1)) {
                        com.aspose.cells.b.a.a.ze.a(var30, (Object)null);
                     }
                  }
               }

               if (var33.equals(var1) && var36.size() > 1) {
                  a(var0, var1, var36, var2);
               }

               com.aspose.cells.b.a.a.ze.a(var29, (Object)var36);
            }
         }

         if (!var7.an()) {
            for(var32 = 0; var32 < var6; ++var32) {
               boolean var58 = false;
               boolean var34 = false;
               float var59 = 0.0F;
               float var60 = 0.0F;
               float var61 = 0.0F;
               boolean var62 = false;
               boolean var63 = false;
               float var64 = 0.0F;
               float var41 = 0.0F;

               int var65;
               for(var65 = 0; var65 < var29.size(); ++var65) {
                  ArrayList var43 = (ArrayList)var29.get(var65);
                  if (var43.size() > var32 && var32 < var43.size() && var43.get(var32) != null) {
                     com.aspose.cells.b.a.b.zo var67 = (com.aspose.cells.b.a.b.zo)var43.get(var32);
                     var61 = var67.d();
                     if (!var58) {
                        var59 = var67.e();
                        var58 = true;
                     } else if (!var34) {
                        if (var59 < var67.e()) {
                           var60 = var59;
                           var59 = var67.e();
                           var34 = true;
                        } else {
                           var60 = var67.e();
                           var34 = true;
                        }
                     } else {
                        if (var59 < var67.e()) {
                           var59 = var67.e();
                        }

                        if (var60 > var67.e()) {
                           var60 = var67.e();
                        }
                     }

                     if (var65 == 0) {
                        var64 = var67.e();
                        var62 = true;
                     } else if (var65 == var29.size() - 1) {
                        var41 = var67.e();
                        var63 = true;
                     }
                  }
               }

               if (var1.N() && var58 && var34) {
                  var21.a(var61, var59, var61, var60);
               }

               if (var1.O() && var62 && var63) {
                  var65 = (int)(var27 / (double)(1.0F + var14));
                  com.aspose.cells.b.a.b.zq var66 = new com.aspose.cells.b.a.b.zq();
                  if (var64 <= var41) {
                     var66.c((float)var65);
                     var66.d(var41 - var64);
                     var66.a(var61 - var66.h() / 2.0F);
                     var66.b(var64);
                     a(var0, var23, var66);
                  } else {
                     var66.c((float)var65);
                     var66.d(var64 - var41);
                     var66.a(var61 - var66.h() / 2.0F);
                     var66.b(var41);
                     a(var0, var22, var66);
                  }
               }
            }
         }

         if (!var7.an()) {
            zbvw.a(var0, var1, var30, var2);
         }

         return var24;
      }
   }

   static void a(zn var0, zbp var1, int var2, int var3, com.aspose.cells.b.a.b.zo var4, int var5) throws Exception {
      zbcs var6 = var1.e().z();
      zbcq var7 = var6.c(var2);
      zje var8 = var7.E().b(var3);
      zpu var9 = var8.o();
      com.aspose.cells.b.a.b.zt var10 = zpw.a(var0, var1, var6, var2, var3, var5);
      float var11 = 0.0F;
      float var12 = 0.0F;
      float var13 = 4.0F;
      if (var7.m() != 12 && var7.m() != 13) {
         if (var8.m().d() != 1) {
            var13 += (float)((int)((float)var8.m().c() / 2.0F));
         }
      } else {
         var13 += var8.a / 2.0F;
      }

      int var14 = var9.j();
      if (var14 == 9) {
         var14 = zpw.b(var6.c(var2).m());
      }

      switch(var14) {
      case 1:
         var11 = var4.d() - var10.b() / 2.0F;
         var12 = var4.e() - var10.c() / 2.0F;
         break;
      case 2:
      case 3:
      case 4:
      default:
         var11 = var4.d() + var13;
         var12 = var4.e() - var10.c() / 2.0F;
         if (var9.e()) {
            var11 += (float)zpw.a;
         }
         break;
      case 5:
         var11 = var4.d() - var10.b() / 2.0F;
         var12 = var4.e() - var10.c() - var13;
         var12 -= (float)zpw.a;
         break;
      case 6:
         var11 = var4.d() - var10.b() / 2.0F;
         var12 = var4.e() + var13;
         var12 += (float)zpw.a;
         break;
      case 7:
         var11 = var4.d() - var10.b() - var13;
         var12 = var4.e() - var10.c() / 2.0F;
         if (var9.e()) {
            var11 -= (float)zpw.a;
         }
      }

      boolean var15 = var9.a().q() && var9.a().p();
      var9.a().b = new com.aspose.cells.b.a.b.zp(zbuk.c((double)var11), zbuk.c((double)var12), zbuk.a((double)var10.b()), zbuk.a((double)var10.c()));
      var9.a().z();
      zpw.a(var0, var1, var6, var2, var3, var9.a().a);
      if (var7.R() && !var15) {
         zpw.a(var0, var7.S(), var9.a().a, var4, 4.0F);
      }

   }

   static void b(zn var0, zig var1, ArrayList var2) throws Exception {
      for(int var3 = 0; var3 < var2.size(); ++var3) {
         Object[] var4 = (Object[])((Object[])var2.get(var3));
         int var5 = (Integer)var4[0];
         int var6 = (Integer)var4[1];
         com.aspose.cells.b.a.b.zo var7 = (com.aspose.cells.b.a.b.zo)var4[2];
         zbp var8 = (zbp)var4[3];
         int var9 = (int)((float)var1.a() * 0.2F);
         a(var0, var8, var5, var6, var7, var9);
      }

   }

   private static ArrayList b(zn var0, zbcq var1, com.aspose.cells.b.a.b.zp var2, float var3, double var4) throws Exception {
      zig var6 = var1.v();
      int[] var7 = new int[]{37, 40};
      int var8 = var1.ag();
      zbcs var9 = var6.z();
      int var10 = var9.getCount();
      float var11 = (float)var1.K() / 100.0F;
      zbp var12;
      zbp var13;
      ArrayList var14;
      if (var8 == 1) {
         var13 = var6.e();
         var12 = var6.G();
         var14 = zia.a(var6.z().c(), var6.X());
      } else {
         var13 = var6.g();
         var12 = var6.I();
         var14 = zia.a(var6.z().d(), var6.X());
      }

      double var15 = var12.n() ? var12.g(var12.z()) : var12.z();
      double var17 = var12.n() ? var12.g(var12.D()) : var12.D();
      var4 = var12.n() ? var12.g(var4) : var4;
      boolean var19 = var1.M();
      zalw var20 = var1.P();
      zalw var21 = var1.Q();
      zix var22 = var1.T();
      zix var23 = var1.U();
      int var24 = var14.size();
      int var25 = var13.j();
      int var26 = (int)var13.D();
      int var27 = (int)var13.z();
      float var28 = 0.0F;
      if (!var13.f() && !var6.u()) {
         var28 = (float)zbr.a(var25, var27, var26, var6.X());
         if (var28 == 0.0F) {
            var28 = 1.0F;
         }

         if (var13.u) {
            var28 += 0.5F;
         }
      } else {
         var28 = (float)(zbr.a(var25, var27, var26, var6.X()) + 1);
      }

      double var29 = (double)var2.e() / (double)var28;
      double var31 = 0.0D;
      ArrayList var33 = new ArrayList();
      ArrayList var34 = new ArrayList();
      ArrayList var35 = new ArrayList();
      Object var36 = new ArrayList();
      if (var6.an() || !var1.N() && !var1.O()) {
         ((List)var36).add(var1);
      } else {
         var36 = var9.a(var8, var7);
      }

      int var37;
      for(var37 = 0; var37 < ((List)var36).size(); ++var37) {
         zbcq var38 = (zbcq)((List)var36).get(var37);
         var9.a(var38, var8, var7);
         int var40 = var38.aj();
         if ((!var6.an() || var38.equals(var1)) && (var1.O() || var1.N() || var38.equals(var1))) {
            ArrayList var41 = new ArrayList();

            for(int var42 = 0; var42 < var24; ++var42) {
               zje var43 = var38.E().b(var42);
               if (var43 != null && !var43.a()) {
                  int var44 = com.aspose.cells.b.a.zo.a(com.aspose.cells.b.a.zr.a(var14.get(var42)));
                  var44 = zbr.a(var25, var44, var6.X());
                  int var45 = zbr.a(var25, var44, var26, var6.X());
                  double var46 = var29 * (double)var45;
                  var31 = var29 * (double)zbr.a(var25, zbr.a(var13.j(), var13.y(), (int)var13.x(), var44, var6.X()), var44, var6.X());
                  if (var13.f() || var6.u()) {
                     var46 += (double)((float)(var29 / 2.0D));
                  }

                  double var48 = 0.0D;
                  if (var13.p()) {
                     var48 = (double)(var2.c() + var2.e()) - var46;
                  } else {
                     var48 = (double)var2.c() + var46;
                  }

                  double var50 = (double)var3;
                  double var52 = var43.v();
                  double var54 = (var52 - var4) / (var15 - var17) * (double)var2.f();
                  zsq var56 = var1.x();
                  com.aspose.cells.b.a.b.zo var57;
                  if (var56 != null && var38.equals(var1) && var56.d() != 2) {
                     var57 = new com.aspose.cells.b.a.b.zo((float)var48, var3);
                     double var58 = 0.0D;
                     double var60 = 0.0D;
                     float var62 = 0.0F;
                     float var63 = 0.0F;
                     switch(var56.g()) {
                     case 0:
                        double var64 = var56.e().size() > var42 ? var56.a(var56.e().get(var42)) : 0.0D;
                        var58 = var64;
                        var64 = var56.f().size() > var42 ? var56.a(var56.f().get(var42)) : 0.0D;
                        var60 = var64;
                        break;
                     case 1:
                        var58 = var56.c();
                        var60 = var58;
                        break;
                     case 2:
                        var58 = var56.c() * var52 / 100.0D;
                        var60 = -var58;
                     }

                     var62 = (float)var58 / (float)(var15 - var17) * (float)var2.f();
                     var63 = (float)var60 / (float)(var15 - var17) * (float)var2.f();
                     if (!var12.p()) {
                        var57.b(var57.e() - (float)var54);
                     } else {
                        var57.b(var57.e() + (float)var54);
                     }

                     var56.a(var57, var62, var63);
                  }

                  if (!var12.p()) {
                     var50 -= var54;
                  } else {
                     var50 += var54;
                  }

                  var57 = new com.aspose.cells.b.a.b.zo((float)var48, (float)var50);
                  if (var41.size() == 0) {
                     com.aspose.cells.b.a.a.ze.a(var41, (Object)var57);
                  } else {
                     a(var57, var41, var13.p());
                  }

                  if (var38.equals(var1)) {
                     if (var19) {
                        var20.a((float)var48, (float)var50, (float)var48, var3);
                     }

                     com.aspose.cells.b.a.a.ze.a(var35, (Object)var57);
                     Object[] var76 = new Object[]{var40, var42, var57, var13};
                     com.aspose.cells.b.a.a.ze.a(var33, (Object)var76);
                  }
               } else {
                  if (var13.p()) {
                     var41.add(0, (Object)null);
                  } else {
                     com.aspose.cells.b.a.a.ze.a(var41, (Object)null);
                  }

                  if (var38.equals(var1)) {
                     com.aspose.cells.b.a.a.ze.a(var35, (Object)null);
                  }
               }
            }

            if (var38.equals(var1) && var41.size() > 1) {
               a(var0, var1, var41, var2);
            }

            com.aspose.cells.b.a.a.ze.a(var34, (Object)var41);
         }
      }

      if (!var6.an() && (var1.N() || var1.O())) {
         for(var37 = 0; var37 < var24; ++var37) {
            boolean var66 = false;
            boolean var39 = false;
            float var67 = 0.0F;
            float var68 = 0.0F;
            float var69 = 0.0F;
            boolean var70 = false;
            boolean var71 = false;
            float var72 = 0.0F;
            float var73 = 0.0F;

            int var47;
            for(var47 = 0; var47 < var34.size(); ++var47) {
               ArrayList var74 = (ArrayList)var34.get(var47);
               if (var74.size() > var37 && var74.get(var37) != null) {
                  com.aspose.cells.b.a.b.zo var49 = (com.aspose.cells.b.a.b.zo)var74.get(var37);
                  var69 = var49.d();
                  if (!var66) {
                     var67 = var49.e();
                     var66 = true;
                  } else if (!var39) {
                     if (var67 < var49.e()) {
                        var68 = var67;
                        var67 = var49.e();
                        var39 = true;
                     } else {
                        var68 = var49.e();
                        var39 = true;
                     }
                  } else {
                     if (var67 < var49.e()) {
                        var67 = var49.e();
                     }

                     if (var68 > var49.e()) {
                        var68 = var49.e();
                     }
                  }

                  if (var47 == 0) {
                     var72 = var49.e();
                     var70 = true;
                  } else if (var47 == var34.size() - 1) {
                     var73 = var49.e();
                     var71 = true;
                  }
               }
            }

            if (var1.N() && var66 && var39) {
               var21.a(var69, var67, var69, var68);
            }

            if (var1.O() && var70 && var71) {
               var47 = (int)(var31 / (double)(1.0F + var11));
               com.aspose.cells.b.a.b.zq var75 = new com.aspose.cells.b.a.b.zq();
               if (var72 <= var73) {
                  var75.c((float)var47);
                  var75.d(var73 - var72);
                  var75.a(var69 - var75.h() / 2.0F);
                  var75.b(var72);
                  a(var0, var23, var75);
               } else {
                  var75.c((float)var47);
                  var75.d(var72 - var73);
                  var75.a(var69 - var75.h() / 2.0F);
                  var75.b(var73);
                  a(var0, var22, var75);
               }
            }
         }
      }

      if (!var6.an()) {
         zbvw.a(var0, var1, var35, var2);
      }

      return var33;
   }

   private static void a(com.aspose.cells.b.a.b.zo var0, ArrayList var1, boolean var2) {
      boolean var3 = false;
      int var4;
      com.aspose.cells.b.a.b.zo var5;
      if (var2) {
         for(var4 = 0; var4 <= var1.size() - 1; ++var4) {
            if (var1.get(var4) == null) {
               var1.add(var4, var0);
               var3 = true;
               break;
            }

            var5 = (com.aspose.cells.b.a.b.zo)var1.get(var4);
            if (var0.d() <= var5.d()) {
               var1.add(var4, var0);
               var3 = true;
               break;
            }
         }

         if (!var3) {
            com.aspose.cells.b.a.a.ze.a(var1, (Object)var0);
         }
      } else {
         for(var4 = var1.size() - 1; var4 >= 0; --var4) {
            if (var1.get(var4) == null) {
               if (var4 == var1.size() - 1) {
                  com.aspose.cells.b.a.a.ze.a(var1, (Object)var0);
               } else {
                  var1.add(var4 + 1, var0);
               }

               var3 = true;
               break;
            }

            var5 = (com.aspose.cells.b.a.b.zo)var1.get(var4);
            if (var0.d() >= var5.d()) {
               if (var4 == var1.size() - 1) {
                  com.aspose.cells.b.a.a.ze.a(var1, (Object)var0);
               } else {
                  var1.add(var4 + 1, var0);
               }

               var3 = true;
               break;
            }
         }

         if (!var3) {
            var1.add(0, var0);
         }
      }

   }

   static ArrayList a(zn var0, zbcq var1, com.aspose.cells.b.a.b.zp var2, int var3) throws Exception {
      zig var4 = var1.v();
      byte var5 = 15;
      zbcs var6 = var4.z();
      int var7 = var6.getCount();
      int var11 = var1.ag();
      int var8;
      zbp var9;
      zbp var10;
      if (var11 == 1) {
         var10 = var4.e();
         var9 = var4.G();
         var8 = var6.b(1, var5);
      } else {
         var10 = var4.g();
         var9 = var4.I();
         var8 = var6.b(2, var5);
      }

      if (var10.k() == 2) {
         return a(var0, var1, var2);
      } else {
         float var12 = 0.0F;
         if (!var9.p()) {
            var12 = (float)var2.d() + (float)var9.z() / (float)(var9.z() - var9.D()) * (float)var2.f();
         } else {
            var12 = (float)var2.j() - (float)var9.z() / (float)(var9.z() - var9.D()) * (float)var2.f();
         }

         float var13 = (float)var1.L() / 100.0F;
         float var14 = (float)var1.K() / 100.0F;
         ArrayList var15 = new ArrayList();
         float var16 = 0.0F;
         int var17 = var3;
         if (var10.p) {
            var17 = (int)var10.z();
         }

         if (!var10.f() && !var4.u()) {
            var16 = (float)(var17 - 1);
            if (var16 == 0.0F) {
               var16 = 1.0F;
            }

            if (var10.u) {
               var16 += 0.5F;
            }
         } else {
            var16 = (float)var17;
         }

         double var18 = (double)var2.e() / (double)var16;
         float var20 = 0.0F;
         List var21 = var6.a(var11, new int[]{var5});
         int var22 = var6.a(var1, var11, new int[]{var5});
         if (var22 == -1) {
            return var15;
         } else {
            int var23 = var1.aj();
            zjg var24 = var1.E();
            ArrayList var25 = new ArrayList();

            for(int var26 = 0; var26 < var24.getCount(); ++var26) {
               zje var27 = var24.b(var26);
               float var28 = (float)var18 / ((float)var8 - var13 * (float)(var8 - 1) + var14);
               float var29 = var28 * var13;
               float var30 = var28 * var14;
               var20 += (float)var22 * (var28 - var29);
               float var31 = (float)var18 * (float)var26 + var30 / 2.0F + var20;
               if (!var10.f() && !var4.u()) {
                  var31 -= (float)(var18 / 2.0D);
               }

               if (var10.p()) {
                  var31 = (float)(var2.c() + var2.e()) - var31 - var28;
               } else {
                  var31 += (float)var2.c();
               }

               ArrayList var32 = new ArrayList();
               if (var27 != null) {
                  double var33 = var27.v();
                  double var35 = var33;
                  int var37;
                  zje var38;
                  double var39;
                  if (var33 >= 0.0D) {
                     for(var37 = 0; var37 < var22; ++var37) {
                        var38 = ((zbcq)var21.get(var37)).E().b(var26);
                        if (var38 != null) {
                           var39 = var38.v();
                           if (var39 > 0.0D) {
                              var35 += var39;
                           }
                        }
                     }
                  } else {
                     for(var37 = 0; var37 < var22; ++var37) {
                        var38 = ((zbcq)var21.get(var37)).E().b(var26);
                        if (var38 != null) {
                           var39 = var38.v();
                           if (var39 <= 0.0D) {
                              var35 += var39;
                           }
                        }
                     }
                  }

                  float var51 = (float)(Math.abs(var33) / (var9.z() - var9.D()) * (double)var2.f());
                  float var52 = (float)(Math.abs(var35) / (var9.z() - var9.D()) * (double)var2.f());
                  boolean var53 = false;
                  if (var51 == 0.0F) {
                     var53 = true;
                  }

                  zsq var40 = var1.x();
                  if (var40 != null && var40.d() != 2) {
                     com.aspose.cells.b.a.b.zo var41 = new com.aspose.cells.b.a.b.zo(var31 + var28 / 2.0F, var12);
                     double var42 = 0.0D;
                     double var44 = 0.0D;
                     float var46 = 0.0F;
                     float var47 = 0.0F;
                     if (var40 != null) {
                        switch(var40.g()) {
                        case 0:
                           double var48 = var40.e().size() > var26 ? var40.a(var40.e().get(var26)) : 0.0D;
                           var42 = var48;
                           var48 = var40.f().size() > var26 ? var40.a(var40.f().get(var26)) : 0.0D;
                           var44 = var48;
                           break;
                        case 1:
                           var42 = var40.c();
                           var44 = var42;
                           break;
                        case 2:
                           var42 = var40.c() * var33 / 100.0D;
                           var44 = -var42;
                        }

                        var46 = (float)var42 / (float)(var9.z() - var9.D()) * (float)var2.f();
                        var47 = (float)var44 / (float)(var9.z() - var9.D()) * (float)var2.f();
                        if (!var9.p()) {
                           if (var33 <= 0.0D) {
                              var41.b(var41.e() + var52);
                           } else {
                              var41.b(var41.e() - var52);
                           }
                        } else if (var33 <= 0.0D) {
                           var41.b(var41.e() - var52);
                        } else {
                           var41.b(var41.e() + var52);
                        }
                     }

                     var40.a(var41, var46, var47);
                  }

                  if (!var9.p()) {
                     if (var33 < 0.0D) {
                        var52 = var12 + var52 - var51;
                     } else {
                        var52 = var12 - var52;
                     }
                  } else if (var33 < 0.0D) {
                     var52 = var12 - var52;
                  } else {
                     var52 = var12 + var52 - var51;
                  }

                  if (var27.k().g()) {
                     --var51;
                  }

                  com.aspose.cells.b.a.b.zq var54 = new com.aspose.cells.b.a.b.zq(var31, var52, var28, var51 + 1.0F);
                  new com.aspose.cells.b.a.b.zq(var54.f(), var54.g(), var54.h(), var54.i());
                  if (var54.g() < (float)var2.d()) {
                     var54.d(var54.i() - ((float)var2.d() - var54.g()));
                     var54.b((float)var2.d());
                  }

                  if (var54.m() > (float)(var2.j() + 1)) {
                     var54.d(var54.i() - (var54.m() - (float)var2.j()));
                  }

                  if (var54.l() >= (float)var2.c() && var54.j() <= (float)var2.i()) {
                     if (var54.f() < (float)var2.c()) {
                        var54.c(var54.h() - ((float)var2.c() - var54.f()));
                        var54.a((float)var2.c());
                     } else if (var54.l() > (float)var2.i()) {
                        var54.c(var54.h() - (var54.l() - (float)var2.i()));
                     }

                     if (var54.h() + 1.0F >= (var28 - 1.0F) / 3.0F) {
                        if (!var53) {
                           a(var0, var27, var54, var12, var9, var2);
                        }

                        Object[] var43 = new Object[5];
                        boolean var55;
                        if (var54.g() + var54.i() / 2.0F < var12) {
                           var55 = true;
                        } else if (var33 != 0.0D) {
                           var55 = false;
                        } else if (var9.p()) {
                           var55 = false;
                        } else {
                           var55 = true;
                        }

                        var43[0] = var23;
                        var43[1] = var26;
                        var43[2] = var54;
                        var43[3] = var10;
                        var43[4] = var55;
                        if (!var27.a()) {
                           com.aspose.cells.b.a.a.ze.a(var15, (Object)var43);
                        }

                        if (var1.Y() && !var27.a()) {
                           com.aspose.cells.b.a.a.ze.a(var32, (Object)var54);
                           com.aspose.cells.b.a.a.ze.a(var32, (Object)var55);
                        }
                     }
                  }
               }

               ArrayList[] var50 = new ArrayList[]{var25};
               a(var0, var1, var50, var32);
               var25 = var50[0];
            }

            return var15;
         }
      }
   }

   private static ArrayList a(zn var0, zbcq var1, com.aspose.cells.b.a.b.zp var2) throws Exception {
      zig var3 = var1.v();
      int var4 = var1.ag();
      byte var5 = 15;
      int var6 = var3.z().getCount();
      zbcs var7 = var3.z();
      float var9 = (float)var1.L() / 100.0F;
      float var10 = (float)var1.K() / 100.0F;
      int var8;
      zbp var11;
      zbp var12;
      ArrayList var13;
      if (var4 == 1) {
         var11 = var3.e();
         var12 = var3.G();
         var8 = var7.b(1, var5);
         var13 = zia.a(var3.z().c(), var3.X());
      } else {
         var11 = var3.g();
         var12 = var3.I();
         var8 = var7.b(2, var5);
         var13 = zia.a(var3.z().d(), var3.X());
      }

      float var14 = 0.0F;
      if (!var12.p()) {
         var14 = (float)var2.d() + (float)var12.z() / (float)(var12.z() - var12.D()) * (float)var2.f();
      } else {
         var14 = (float)var2.j() - (float)var12.z() / (float)(var12.z() - var12.D()) * (float)var2.f();
      }

      double var15 = var12.D();
      double var17 = var12.z();
      ArrayList var19 = new ArrayList();
      int var20 = var13.size();
      int var21 = var11.j();
      int var22 = (int)var11.D();
      int var23 = (int)var11.z();
      float var24 = 0.0F;
      if (!var11.f() && !var3.u()) {
         var24 = (float)zbr.a(var21, var23, var22, var3.X());
         if (var24 == 0.0F) {
            var24 = 1.0F;
         }

         if (var11.u) {
            var24 += 0.5F;
         }
      } else {
         var24 = (float)(zbr.a(var21, var23, var22, var3.X()) + 1);
      }

      double var25 = (double)var2.e() / (double)var24;
      ArrayList var27 = new ArrayList();

      for(int var28 = 0; var28 < var20; ++var28) {
         zje var29 = var1.E().b(var28);
         float var30 = (float)(var25 / (double)((float)var8 - var9 * (float)(var8 - 1) + var10));
         float var31 = var30 * var9;
         float var32 = var30 * var10;
         int var33 = com.aspose.cells.b.a.zo.a(com.aspose.cells.b.a.zr.a(var13.get(var28)));
         var33 = zbr.a(var21, var33, var3.X());
         int var34 = zbr.a(var21, var33, var22, var3.X());
         float var35 = (float)(var25 * (double)var34);
         if (!var11.f() && !var3.u()) {
            var35 -= (float)(var25 / 2.0D);
         }

         float var36 = 0.0F;
         if (var11.p()) {
            var36 = (float)(var2.c() + var2.e()) - var35 - var32 / 2.0F - var30 - 1.0F;
         } else {
            var36 = (float)var2.c() + var35 + var32 / 2.0F + 1.0F;
         }

         List var37 = var7.a(var4, new int[]{var5});
         int var38 = var7.a(var1, var4, new int[]{var5});
         if (var38 == -1) {
            return var19;
         }

         int var39 = var1.aj();
         if (var11.p()) {
            var36 -= (float)var38 * (var30 - var31);
         } else {
            var36 += (float)var38 * (var30 - var31);
         }

         ArrayList var40 = new ArrayList();
         if (var29 != null) {
            double var41 = var29.v();
            double var43 = var41;
            int var45;
            zje var46;
            double var47;
            if (var41 >= 0.0D) {
               for(var45 = 0; var45 < var38; ++var45) {
                  var46 = ((zbcq)var37.get(var45)).E().b(var28);
                  if (var46 != null) {
                     var47 = var46.v();
                     if (var47 > 0.0D) {
                        var43 += var47;
                     }
                  }
               }
            } else {
               for(var45 = 0; var45 < var38; ++var45) {
                  var46 = ((zbcq)var37.get(var45)).E().b(var28);
                  if (var46 != null) {
                     var47 = var46.v();
                     if (var47 <= 0.0D) {
                        var43 += var47;
                     }
                  }
               }
            }

            float var59 = (float)(Math.abs(var41) / (var12.z() - var12.D()) * (double)var2.f());
            float var60 = (float)(Math.abs(var43) / (var12.z() - var12.D()) * (double)var2.f());
            boolean var61 = false;
            if (var59 == 0.0F) {
               var61 = true;
            }

            zsq var48 = var1.x();
            if (var48 != null && var48.d() != 2) {
               com.aspose.cells.b.a.b.zo var49 = new com.aspose.cells.b.a.b.zo(var36 + var30 / 2.0F, var14);
               double var50 = 0.0D;
               double var52 = 0.0D;
               float var54 = 0.0F;
               float var55 = 0.0F;
               if (var48 != null) {
                  switch(var48.g()) {
                  case 0:
                     double var56 = var48.e().size() > var28 ? var48.a(var48.e().get(var28)) : 0.0D;
                     var50 = var56;
                     var56 = var48.f().size() > var28 ? var48.a(var48.f().get(var28)) : 0.0D;
                     var52 = var56;
                     break;
                  case 1:
                     var50 = var48.c();
                     var52 = var50;
                     break;
                  case 2:
                     var50 = var48.c() * var41 / 100.0D;
                     var52 = -var50;
                  }

                  var54 = (float)var50 / (float)(var12.z() - var12.D()) * (float)var2.f();
                  var55 = (float)var52 / (float)(var12.z() - var12.D()) * (float)var2.f();
                  if (!var12.p()) {
                     if (var41 <= 0.0D) {
                        var49.b(var49.e() + var60);
                     } else {
                        var49.b(var49.e() - var60);
                     }
                  } else if (var41 <= 0.0D) {
                     var49.b(var49.e() - var60);
                  } else {
                     var49.b(var49.e() + var60);
                  }
               }

               var48.a(var49, var54, var55);
            }

            if (!var12.p()) {
               if (var41 < 0.0D) {
                  var60 = var14 + var60 - var59;
               } else {
                  var60 = var14 - var60;
               }
            } else if (var41 < 0.0D) {
               var60 = var14 - var60;
            } else {
               var60 = var14 + var60 - var59;
            }

            if (var29.k().g()) {
               --var59;
            }

            com.aspose.cells.b.a.b.zq var62 = new com.aspose.cells.b.a.b.zq(var36, var60, var30, var59 + 1.0F);
            com.aspose.cells.b.a.b.zq var63 = new com.aspose.cells.b.a.b.zq(var62.f(), var62.g(), var62.h(), var62.i());
            if (var62.g() < (float)var2.d()) {
               var62.d(var62.i() - ((float)var2.d() - var62.g()));
               var62.b((float)var2.d());
            }

            if (var62.m() > (float)(var2.j() + 1)) {
               var62.d(var62.i() - (var62.m() - (float)var2.j()));
            }

            if (var62.l() >= (float)var2.c() && var62.j() <= (float)var2.i()) {
               if (var62.f() < (float)var2.c()) {
                  var62.c(var62.h() - ((float)var2.c() - var62.f()));
                  var62.a((float)var2.c());
               } else if (var62.l() > (float)var2.i()) {
                  var62.c(var62.h() - (var62.l() - (float)var2.i()));
               }

               if (var62.h() + 1.0F >= (var30 - 1.0F) / 3.0F) {
                  if (!var61) {
                     a(var0, var29, var62, var14, var12, var2);
                  }

                  Object[] var51 = new Object[5];
                  boolean var64;
                  if (var62.g() + var62.i() / 2.0F < var14) {
                     var64 = true;
                  } else if (var41 != 0.0D) {
                     var64 = false;
                  } else if (var12.p()) {
                     var64 = false;
                  } else {
                     var64 = true;
                  }

                  var51[0] = var39;
                  var51[1] = var28;
                  var51[2] = var63;
                  var51[3] = var11;
                  var51[4] = var64;
                  if (!var29.a()) {
                     com.aspose.cells.b.a.a.ze.a(var19, (Object)var51);
                  }

                  if (var1.Y()) {
                     com.aspose.cells.b.a.a.ze.a(var40, (Object)var62);
                     com.aspose.cells.b.a.a.ze.a(var40, (Object)var64);
                  }
               }
            }
         }

         ArrayList[] var58 = new ArrayList[]{var27};
         a(var0, var1, var58, var40);
         var27 = var58[0];
      }

      return var19;
   }

   static ArrayList a(zn var0, zbcq var1, com.aspose.cells.b.a.b.zp var2, float var3, int var4) throws Exception {
      zig var5 = var1.v();
      int[] var6 = new int[]{38, 41};
      int var7 = var1.ag();
      zbp var8;
      zbp var9;
      if (var7 == 1) {
         var9 = var5.e();
         var8 = var5.G();
      } else {
         var9 = var5.g();
         var8 = var5.I();
      }

      if (var9.k() == 2) {
         return a(var0, var1, var2, var3);
      } else {
         float var10 = 0.0F;
         if (!var8.p()) {
            var10 = (float)var2.d() + (float)var8.z() / (float)(var8.z() - var8.D()) * (float)var2.f();
         } else {
            var10 = (float)var2.j() - (float)var8.z() / (float)(var8.z() - var8.D()) * (float)var2.f();
         }

         zbcs var11 = var5.z();
         int var12 = var11.getCount();
         float var13 = (float)var1.K() / 100.0F;
         double var14 = var8.D();
         double var16 = var8.z();
         boolean var18 = var1.M();
         zalw var19 = var1.P();
         zalw var20 = var1.Q();
         zix var21 = var1.T();
         zix var22 = var1.U();
         ArrayList var23 = new ArrayList();
         float var24 = 0.0F;
         int var25 = var4;
         if (var9.p) {
            var25 = (int)var9.z();
         }

         if (!var9.f() && !var5.u()) {
            var24 = (float)(var25 - 1);
            if (var24 == 0.0F) {
               var24 = 1.0F;
            }

            if (var9.u) {
               var24 += 0.5F;
            }
         } else {
            var24 = (float)var25;
         }

         double var26 = (double)var2.e() / (double)var24;
         ArrayList var28 = new ArrayList();
         ArrayList var29 = new ArrayList();
         List var30 = var11.a(var7, var6);

         int var31;
         for(var31 = 0; var31 < var30.size(); ++var31) {
            zbcq var32 = (zbcq)var30.get(var31);
            int var33 = var11.a(var32, var7, var6);
            int var34 = var32.aj();
            if ((!var5.an() || var32.equals(var1)) && (var1.O() || var1.N() || var32.equals(var1))) {
               ArrayList var35 = new ArrayList();
               zjg var36 = var32.E();

               for(int var37 = 0; var37 < var4; ++var37) {
                  zje var38 = var36.b(var37);
                  if (var38 != null && !var38.a()) {
                     double var39 = (double)((float)var26 * (float)var37 + 1.0F);
                     if (var9.f() || var5.u()) {
                        var39 += (double)((float)(var26 / 2.0D));
                     }

                     if (var9.p()) {
                        var39 = (double)(var2.c() + var2.e()) - var39;
                     } else {
                        var39 += (double)var2.c();
                     }

                     double var41 = var38.v();
                     double var43 = var41;
                     int var45;
                     zje var46;
                     double var47;
                     if (var41 >= 0.0D) {
                        for(var45 = 0; var45 < var33; ++var45) {
                           var46 = ((zbcq)var30.get(var45)).E().b(var37);
                           if (var46 != null) {
                              var47 = var46.v();
                              if (var47 > 0.0D) {
                                 var43 += var47;
                              }
                           }
                        }
                     } else {
                        for(var45 = 0; var45 < var33; ++var45) {
                           var46 = ((zbcq)var30.get(var45)).E().b(var37);
                           if (var46 != null) {
                              var47 = var46.v();
                              if (var47 <= 0.0D) {
                                 var43 += var47;
                              }
                           }
                        }
                     }

                     float var67 = (float)(Math.abs(var43) / (var8.z() - var8.D()) * (double)var2.f());
                     zsq var68 = var1.x();
                     com.aspose.cells.b.a.b.zo var69;
                     if (var68 != null && var68.d() != 2 && var32.equals(var1)) {
                        var69 = new com.aspose.cells.b.a.b.zo((float)var39, var10);
                        double var48 = 0.0D;
                        double var50 = 0.0D;
                        float var52 = 0.0F;
                        float var53 = 0.0F;
                        if (var68 != null) {
                           switch(var68.g()) {
                           case 0:
                              double var54 = var68.e().size() > var37 ? var68.a(var68.e().get(var37)) : 0.0D;
                              var48 = var54;
                              var54 = var68.f().size() > var37 ? var68.a(var68.f().get(var37)) : 0.0D;
                              var50 = var54;
                              break;
                           case 1:
                              var48 = var68.c();
                              var50 = var48;
                              break;
                           case 2:
                              var48 = var68.c() * var41 / 100.0D;
                              var50 = -var48;
                           }

                           var52 = (float)var48 / (float)(var8.z() - var8.D()) * (float)var2.f();
                           var53 = (float)var50 / (float)(var8.z() - var8.D()) * (float)var2.f();
                           if (!var8.p()) {
                              if (var41 < 0.0D) {
                                 var69.b(var69.e() + var67);
                              } else {
                                 var69.b(var69.e() - var67);
                              }
                           } else if (var41 < 0.0D) {
                              var69.b(var69.e() - var67);
                           } else {
                              var69.b(var69.e() + var67);
                           }
                        }

                        if (var32.equals(var1)) {
                           var68.a(var69, var52, var53);
                        }
                     }

                     if (!var8.p()) {
                        if (var41 < 0.0D) {
                           var67 += var10;
                        } else {
                           var67 = var10 - var67;
                        }
                     } else if (var41 < 0.0D) {
                        var67 = var10 - var67;
                     } else {
                        var67 += var10;
                     }

                     var69 = new com.aspose.cells.b.a.b.zo((float)var39, var67);
                     com.aspose.cells.b.a.a.ze.a(var35, (Object)var69);
                     if (var32.equals(var1)) {
                        if (var18) {
                           var19.a((float)var39, var67, (float)var39, var3);
                        }

                        com.aspose.cells.b.a.a.ze.a(var29, (Object)var69);
                        Object[] var70 = new Object[]{var34, var37, var69, var9};
                        com.aspose.cells.b.a.a.ze.a(var23, (Object)var70);
                     }
                  } else {
                     com.aspose.cells.b.a.a.ze.a(var35, (Object)null);
                     if (var32.equals(var1)) {
                        com.aspose.cells.b.a.a.ze.a(var29, (Object)null);
                     }
                  }
               }

               if (var32.equals(var1) && var35.size() > 1) {
                  a(var0, var1, var35, var2);
               }

               com.aspose.cells.b.a.a.ze.a(var28, (Object)var35);
            }
         }

         if (!var5.an()) {
            for(var31 = 0; var31 < var4; ++var31) {
               boolean var56 = false;
               boolean var57 = false;
               float var58 = 0.0F;
               float var59 = 0.0F;
               float var60 = 0.0F;
               boolean var61 = false;
               boolean var62 = false;
               float var64 = 0.0F;
               float var40 = 0.0F;

               int var63;
               for(var63 = 0; var63 < var28.size(); ++var63) {
                  ArrayList var42 = (ArrayList)var28.get(var63);
                  if (var42.size() > var31 && var42.get(var31) != null) {
                     com.aspose.cells.b.a.b.zo var66 = (com.aspose.cells.b.a.b.zo)var42.get(var31);
                     var60 = var66.d();
                     if (!var56) {
                        var58 = var66.e();
                        var56 = true;
                     } else if (!var57) {
                        if (var58 < var66.e()) {
                           var59 = var58;
                           var58 = var66.e();
                           var57 = true;
                        } else {
                           var59 = var66.e();
                           var57 = true;
                        }
                     } else {
                        if (var58 < var66.e()) {
                           var58 = var66.e();
                        }

                        if (var59 > var66.e()) {
                           var59 = var66.e();
                        }
                     }

                     if (var63 == 0) {
                        var64 = var66.e();
                        var61 = true;
                     } else if (var63 == var28.size() - 1) {
                        var40 = var66.e();
                        var62 = true;
                     }
                  }
               }

               if (var1.N() && var56 && var57) {
                  var20.a(var60, var58, var60, var59);
               }

               if (var1.O() && var61 && var62) {
                  var63 = (int)(var26 / (double)(1.0F + var13));
                  com.aspose.cells.b.a.b.zq var65 = new com.aspose.cells.b.a.b.zq();
                  if (var64 <= var40) {
                     var65.c((float)var63);
                     var65.d(var40 - var64);
                     var65.a(var60 - var65.h() / 2.0F);
                     var65.b(var64);
                     a(var0, var22, var65);
                  } else {
                     var65.c((float)var63);
                     var65.d(var64 - var40);
                     var65.a(var60 - var65.h() / 2.0F);
                     var65.b(var40);
                     a(var0, var21, var65);
                  }
               }
            }
         }

         if (!var5.an()) {
            zbvw.a(var0, var1, var29, var2);
         }

         return var23;
      }
   }

   private static ArrayList a(zn var0, zbcq var1, com.aspose.cells.b.a.b.zp var2, float var3) throws Exception {
      zig var4 = var1.v();
      int[] var5 = new int[]{38, 41};
      int var6 = var1.ag();
      zbcs var7 = var4.z();
      int var8 = var7.getCount();
      float var9 = (float)var1.K() / 100.0F;
      zbp var10;
      zbp var11;
      ArrayList var12;
      if (var6 == 1) {
         var11 = var4.e();
         var10 = var4.G();
         var12 = zia.a(var4.z().c(), var4.X());
      } else {
         var11 = var4.g();
         var10 = var4.I();
         var12 = zia.a(var4.z().d(), var4.X());
      }

      float var13 = 0.0F;
      if (!var10.p()) {
         var13 = (float)var2.d() + (float)var10.z() / (float)(var10.z() - var10.D()) * (float)var2.f();
      } else {
         var13 = (float)var2.j() - (float)var10.z() / (float)(var10.z() - var10.D()) * (float)var2.f();
      }

      double var14 = var10.D();
      double var16 = var10.z();
      boolean var18 = var1.M();
      zalw var19 = var1.P();
      zalw var20 = var1.Q();
      zix var21 = var1.T();
      zix var22 = var1.U();
      int var23 = var12.size();
      int var24 = var11.j();
      int var25 = (int)var11.D();
      int var26 = (int)var11.z();
      float var27 = 0.0F;
      if (!var11.f() && !var4.u()) {
         var27 = (float)zbr.a(var24, var26, var25, var4.X());
         if (var27 == 0.0F) {
            var27 = 1.0F;
         }

         if (var11.u) {
            var27 += 0.5F;
         }
      } else {
         var27 = (float)(zbr.a(var24, var26, var25, var4.X()) + 1);
      }

      double var28 = (double)var2.e() / (double)var27;
      float var30 = 0.0F;
      ArrayList var31 = new ArrayList();
      ArrayList var32 = new ArrayList();
      ArrayList var33 = new ArrayList();
      List var34 = var7.a(var6, var5);

      int var35;
      float var44;
      for(var35 = 0; var35 < var34.size(); ++var35) {
         zbcq var36 = (zbcq)var34.get(var35);
         if ((!var4.an() || var36.equals(var1)) && (var1.O() || var1.N() || var36.equals(var1))) {
            int var37 = var7.a(var36, var6, var5);
            int var38 = var36.aj();
            ArrayList var39 = new ArrayList();

            for(int var40 = 0; var40 < var23; ++var40) {
               zje var41 = var36.E().b(var40);
               if (var41 != null && !var41.a()) {
                  int var42 = com.aspose.cells.b.a.zo.a(com.aspose.cells.b.a.zr.a(var12.get(var40)));
                  var42 = zbr.a(var24, var42, var4.X());
                  int var43 = zbr.a(var24, var42, var25, var4.X());
                  var44 = (float)(var28 * (double)var43);
                  var30 = (float)(var28 * (double)zbr.a(var24, zbr.a(var11.j(), var11.y(), (int)var11.x(), var42, var4.X()), var42, var4.X()));
                  if (var11.f() || var4.u()) {
                     var44 += (float)(var28 / 2.0D);
                  }

                  float var45 = 0.0F;
                  if (var11.p()) {
                     var45 = (float)(var2.c() + var2.e()) - var44;
                  } else {
                     var45 = (float)var2.c() + var44;
                  }

                  double var46 = var41.v();
                  double var48 = var46;
                  int var50;
                  zje var51;
                  double var52;
                  if (var46 >= 0.0D) {
                     for(var50 = 0; var50 < var37; ++var50) {
                        var51 = ((zbcq)var34.get(var50)).E().b(var40);
                        if (var51 != null) {
                           var52 = var51.v();
                           if (var52 > 0.0D) {
                              var48 += var52;
                           }
                        }
                     }
                  } else {
                     for(var50 = 0; var50 < var37; ++var50) {
                        var51 = ((zbcq)var34.get(var50)).E().b(var40);
                        if (var51 != null) {
                           var52 = var51.v();
                           if (var52 <= 0.0D) {
                              var48 += var52;
                           }
                        }
                     }
                  }

                  float var72 = (float)(Math.abs(var48) / (var10.z() - var10.D()) * (double)var2.f());
                  zsq var73 = var1.x();
                  com.aspose.cells.b.a.b.zo var74;
                  if (var73 != null && var73.d() != 2 && var36.equals(var1)) {
                     var74 = new com.aspose.cells.b.a.b.zo(var45, var13);
                     double var53 = 0.0D;
                     double var55 = 0.0D;
                     float var57 = 0.0F;
                     float var58 = 0.0F;
                     if (var73 != null) {
                        switch(var73.g()) {
                        case 0:
                           double var59 = var73.e().size() > var40 ? var73.a(var73.e().get(var40)) : 0.0D;
                           var53 = var59;
                           var59 = var73.f().size() > var40 ? var73.a(var73.f().get(var40)) : 0.0D;
                           var55 = var59;
                           break;
                        case 1:
                           var53 = var73.c();
                           var55 = var53;
                           break;
                        case 2:
                           var53 = var73.c() * var46 / 100.0D;
                           var55 = -var53;
                        }

                        var57 = (float)var53 / (float)(var10.z() - var10.D()) * (float)var2.f();
                        var58 = (float)var55 / (float)(var10.z() - var10.D()) * (float)var2.f();
                        if (!var10.p()) {
                           if (var46 < 0.0D) {
                              var74.b(var74.e() + var72);
                           } else {
                              var74.b(var74.e() - var72);
                           }
                        } else if (var46 < 0.0D) {
                           var74.b(var74.e() - var72);
                        } else {
                           var74.b(var74.e() + var72);
                        }
                     }

                     if (var36.equals(var1)) {
                        var73.a(var74, var57, var58);
                     }
                  }

                  if (!var10.p()) {
                     if (var46 < 0.0D) {
                        var72 += var13;
                     } else {
                        var72 = var13 - var72;
                     }
                  } else if (var46 < 0.0D) {
                     var72 = var13 - var72;
                  } else {
                     var72 += var13;
                  }

                  var74 = new com.aspose.cells.b.a.b.zo(var45, var72);
                  if (var39.size() == 0) {
                     com.aspose.cells.b.a.a.ze.a(var39, (Object)var74);
                  } else {
                     a(var74, var39, var11.p());
                  }

                  if (var36.equals(var1)) {
                     if (var18) {
                        var19.a(var45, var72, var45, var3);
                     }

                     com.aspose.cells.b.a.a.ze.a(var33, (Object)var74);
                     Object[] var75 = new Object[]{var38, var40, var74, var11};
                     com.aspose.cells.b.a.a.ze.a(var31, (Object)var75);
                  }
               } else {
                  if (var11.p()) {
                     var39.add(0, (Object)null);
                  } else {
                     com.aspose.cells.b.a.a.ze.a(var39, (Object)null);
                  }

                  if (var36.equals(var1)) {
                     com.aspose.cells.b.a.a.ze.a(var33, (Object)null);
                  }
               }
            }

            if (var36.equals(var1)) {
               a(var0, var36, var39, var2);
            }

            com.aspose.cells.b.a.a.ze.a(var32, (Object)var39);
         }
      }

      if (!var4.an()) {
         for(var35 = 0; var35 < var23; ++var35) {
            boolean var61 = false;
            boolean var62 = false;
            float var63 = 0.0F;
            float var64 = 0.0F;
            float var65 = 0.0F;
            boolean var66 = false;
            boolean var67 = false;
            float var68 = 0.0F;
            var44 = 0.0F;

            int var70;
            for(var70 = 0; var70 < var32.size(); ++var70) {
               ArrayList var69 = (ArrayList)var32.get(var70);
               if (var69.size() > var35 && var69.get(var35) != null) {
                  com.aspose.cells.b.a.b.zo var47 = (com.aspose.cells.b.a.b.zo)var69.get(var35);
                  var65 = var47.d();
                  if (!var61) {
                     var63 = var47.e();
                     var61 = true;
                  } else if (!var62) {
                     if (var63 < var47.e()) {
                        var64 = var63;
                        var63 = var47.e();
                        var62 = true;
                     } else {
                        var64 = var47.e();
                        var62 = true;
                     }
                  } else {
                     if (var63 < var47.e()) {
                        var63 = var47.e();
                     }

                     if (var64 > var47.e()) {
                        var64 = var47.e();
                     }
                  }

                  if (var70 == 0) {
                     var68 = var47.e();
                     var66 = true;
                  } else if (var70 == var32.size() - 1) {
                     var44 = var47.e();
                     var67 = true;
                  }
               }
            }

            if (var1.N() && var61 && var62) {
               var20.a(var65, var63, var65, var64);
            }

            if (var1.O() && var66 && var67) {
               var70 = (int)(var30 / (1.0F + var9));
               com.aspose.cells.b.a.b.zq var71 = new com.aspose.cells.b.a.b.zq();
               if (var68 <= var44) {
                  var71.c((float)var70);
                  var71.d(var44 - var68);
                  var71.a(var65 - var71.h() / 2.0F);
                  var71.b(var68);
                  a(var0, var22, var71);
               } else {
                  var71.c((float)var70);
                  var71.d(var68 - var44);
                  var71.a(var65 - var71.h() / 2.0F);
                  var71.b(var44);
                  a(var0, var21, var71);
               }
            }
         }
      }

      if (!var4.an()) {
         zbvw.a(var0, var1, var33, var2);
      }

      return var31;
   }

   static ArrayList b(zn var0, zbcq var1, com.aspose.cells.b.a.b.zp var2, int var3) throws Exception {
      zig var4 = var1.v();
      int var5 = var1.ag();
      byte var6 = 16;
      zbcs var7 = var4.z();
      int var8 = var7.getCount();
      int var9;
      zbp var10;
      zbp var11;
      if (var5 == 1) {
         var11 = var4.e();
         var10 = var4.G();
         var9 = var7.b(1, var6);
      } else {
         var11 = var4.g();
         var10 = var4.I();
         var9 = var7.b(2, var6);
      }

      if (var11.k() == 2) {
         return b(var0, var1, var2);
      } else {
         float var12 = 0.0F;
         if (!var10.p()) {
            var12 = (float)var2.d() + (float)var10.z() / (float)(var10.z() - var10.D()) * (float)var2.f();
         } else {
            var12 = (float)var2.j() - (float)var10.z() / (float)(var10.z() - var10.D()) * (float)var2.f();
         }

         float var13 = (float)var1.L() / 100.0F;
         float var14 = (float)var1.K() / 100.0F;
         ArrayList var15 = new ArrayList();
         float var16 = 0.0F;
         int var17 = var3;
         if (var11.p) {
            var17 = (int)var11.z();
         }

         if (!var11.f() && !var4.u()) {
            var16 = (float)(var17 - 1);
            if (var16 == 0.0F) {
               var16 = 1.0F;
            }

            if (var11.u) {
               var16 += 0.5F;
            }
         } else {
            var16 = (float)var17;
         }

         double var18 = (double)var2.e() / (double)var16;
         float var20 = 0.0F;
         List var21 = var7.a(var5, new int[]{var6});
         int var22 = var7.a(var1, var5, new int[]{var6});
         if (var22 == -1) {
            return var15;
         } else {
            int var23 = var1.aj();
            zjg var24 = var1.E();
            ArrayList var25 = new ArrayList();

            for(int var26 = 0; var26 < var24.getCount(); ++var26) {
               zje var27 = var24.b(var26);
               float var28 = (float)var18 / ((float)var9 - var13 * (float)(var9 - 1) + var14);
               float var29 = var28 * var13;
               float var30 = var28 * var14;
               var20 = (float)var22 * (var28 - var29);
               float var31 = (float)var18 * (float)var26 + var30 / 2.0F + var20;
               if (!var11.f() && !var4.u()) {
                  var31 -= (float)(var18 / 2.0D);
               }

               if (var11.p()) {
                  var31 = (float)(var2.c() + var2.e()) - var31 - var28;
               } else {
                  var31 += (float)var2.c();
               }

               ArrayList var32 = new ArrayList();
               if (var27 != null) {
                  double var33 = var27.v();
                  double var35 = var33;
                  double var37 = 0.0D;
                  int var39;
                  zje var40;
                  double var41;
                  if (var33 >= 0.0D) {
                     for(var39 = 0; var39 < var22; ++var39) {
                        var40 = ((zbcq)var21.get(var39)).E().b(var26);
                        if (var40 != null) {
                           var41 = var40.v();
                           if (var41 > 0.0D) {
                              var35 += var41;
                           }
                        }
                     }
                  } else {
                     for(var39 = 0; var39 < var22; ++var39) {
                        var40 = ((zbcq)var21.get(var39)).E().b(var26);
                        if (var40 != null) {
                           var41 = var40.v();
                           if (var41 <= 0.0D) {
                              var35 += var41;
                           }
                        }
                     }
                  }

                  for(var39 = 0; var39 < var21.size(); ++var39) {
                     var40 = ((zbcq)var21.get(var39)).E().b(var26);
                     if (var40 != null) {
                        var41 = var40.v();
                        var37 += Math.abs(var41);
                     }
                  }

                  if (var37 == 0.0D || var37 == 0.0D) {
                     continue;
                  }

                  float var53 = (float)(Math.abs(var33) * 100.0D / var37 / (var10.z() - var10.D()) * (double)var2.f());
                  float var54 = (float)(Math.abs(var35) * 100.0D / var37 / (var10.z() - var10.D()) * (double)var2.f());
                  boolean var55 = false;
                  if (var53 == 0.0F) {
                     var55 = true;
                  }

                  zsq var42 = var1.x();
                  if (var42 != null && var42.d() != 2) {
                     com.aspose.cells.b.a.b.zo var43 = new com.aspose.cells.b.a.b.zo(var31 + var28 / 2.0F, var12);
                     double var44 = 0.0D;
                     double var46 = 0.0D;
                     float var48 = 0.0F;
                     float var49 = 0.0F;
                     if (var42 != null) {
                        switch(var42.g()) {
                        case 0:
                           double var50 = var42.e().size() > var26 ? var42.a(var42.e().get(var26)) : 0.0D;
                           var44 = var50;
                           var50 = var42.f().size() > var26 ? var42.a(var42.f().get(var26)) : 0.0D;
                           var46 = var50;
                           break;
                        case 1:
                           var44 = var42.c();
                           var46 = var44;
                           break;
                        case 2:
                           var44 = var42.c() * var33 / 100.0D;
                           var46 = -var44;
                        }

                        var46 = var46 * 100.0D / var37;
                        var44 = var44 * 100.0D / var37;
                        var48 = (float)var44 / (float)(var10.z() - var10.D()) * (float)var2.f();
                        var49 = (float)var46 / (float)(var10.z() - var10.D()) * (float)var2.f();
                        if (!var10.p()) {
                           if (var33 <= 0.0D) {
                              var43.b(var43.e() + var54);
                           } else {
                              var43.b(var43.e() - var54);
                           }
                        } else if (var33 <= 0.0D) {
                           var43.b(var43.e() - var54);
                        } else {
                           var43.b(var43.e() + var54);
                        }
                     }

                     var42.a(var43, var48, var49);
                  }

                  if (!var10.p()) {
                     if (var33 < 0.0D) {
                        var54 = var12 + var54 - var53;
                     } else {
                        var54 = var12 - var54;
                     }
                  } else if (var33 < 0.0D) {
                     var54 = var12 - var54;
                  } else {
                     var54 = var12 + var54 - var53;
                  }

                  if (var27.k().g()) {
                     --var53;
                  }

                  com.aspose.cells.b.a.b.zq var56 = new com.aspose.cells.b.a.b.zq(var31, var54, var28, var53 + 1.0F);
                  com.aspose.cells.b.a.b.zq var57 = new com.aspose.cells.b.a.b.zq(var56.f(), var56.g(), var56.h(), var56.i());
                  if (var56.g() < (float)var2.d()) {
                     var56.d(var56.i() - ((float)var2.d() - var56.g()));
                     var56.b((float)var2.d());
                  }

                  if (var56.m() > (float)(var2.j() + 1)) {
                     var56.d(var56.i() - (var56.m() - (float)var2.j()));
                  }

                  if (var56.l() >= (float)var2.c() && var56.j() <= (float)var2.i()) {
                     if (var56.f() < (float)var2.c()) {
                        var56.c(var56.h() - ((float)var2.c() - var56.f()));
                        var56.a((float)var2.c());
                     } else if (var56.l() > (float)var2.i()) {
                        var56.c(var56.h() - (var56.l() - (float)var2.i()));
                     }

                     if (var56.h() + 1.0F >= (var28 - 1.0F) / 3.0F) {
                        if (!var55) {
                           a(var0, var27, var56, var12, var10, var2);
                        }

                        Object[] var45 = new Object[5];
                        boolean var58;
                        if (var56.g() + var56.i() / 2.0F < var12) {
                           var58 = true;
                        } else if (var33 != 0.0D) {
                           var58 = false;
                        } else if (var10.p()) {
                           var58 = false;
                        } else {
                           var58 = true;
                        }

                        var45[0] = var23;
                        var45[1] = var26;
                        var45[2] = var57;
                        var45[3] = var11;
                        var45[4] = var58;
                        if (!var27.a()) {
                           com.aspose.cells.b.a.a.ze.a(var15, (Object)var45);
                        }

                        if (var1.Y()) {
                           com.aspose.cells.b.a.a.ze.a(var32, (Object)var56);
                           com.aspose.cells.b.a.a.ze.a(var32, (Object)var58);
                        }
                     }
                  }
               }

               ArrayList[] var52 = new ArrayList[]{var25};
               a(var0, var1, var52, var32);
               var25 = var52[0];
            }

            return var15;
         }
      }
   }

   private static void a(zn var0, zbcq var1, ArrayList[] var2, ArrayList var3) {
      if (var2[0].size() > 0 && var3.size() > 0 && var1.Y()) {
         com.aspose.cells.b.a.b.zq var4 = (com.aspose.cells.b.a.b.zq)var2[0].get(0);
         boolean var5 = (Boolean)var2[0].get(1);
         com.aspose.cells.b.a.b.zq var6 = (com.aspose.cells.b.a.b.zq)var3.get(0);
         boolean var7 = (Boolean)var3.get(1);
         com.aspose.cells.b.a.b.zo var8;
         com.aspose.cells.b.a.b.zo var9;
         if (var4.f() < var6.f()) {
            if (var5) {
               var8 = new com.aspose.cells.b.a.b.zo(var4.l(), var4.k());
            } else {
               var8 = new com.aspose.cells.b.a.b.zo(var4.l(), var4.m());
            }

            if (var7) {
               var9 = new com.aspose.cells.b.a.b.zo(var6.j(), var6.k());
            } else {
               var9 = new com.aspose.cells.b.a.b.zo(var6.j(), var6.m());
            }
         } else {
            if (var5) {
               var8 = new com.aspose.cells.b.a.b.zo(var4.j(), var4.k());
            } else {
               var8 = new com.aspose.cells.b.a.b.zo(var4.j(), var4.m());
            }

            if (var7) {
               var9 = new com.aspose.cells.b.a.b.zo(var6.l(), var6.k());
            } else {
               var9 = new com.aspose.cells.b.a.b.zo(var6.l(), var6.m());
            }
         }

         var1.Z().a(var9, var8);
      }

      if (var3.size() > 0) {
         var2[0] = var3;
      }

   }

   private static ArrayList b(zn var0, zbcq var1, com.aspose.cells.b.a.b.zp var2) throws Exception {
      zig var3 = var1.v();
      int var4 = var1.ag();
      byte var5 = 16;
      int var6 = var3.z().getCount();
      zbcs var7 = var3.z();
      float var9 = (float)var1.L() / 100.0F;
      float var10 = (float)var1.K() / 100.0F;
      int var8;
      zbp var11;
      zbp var12;
      ArrayList var13;
      if (var4 == 1) {
         var11 = var3.e();
         var12 = var3.G();
         var8 = var7.b(1, var5);
         var13 = zia.a(var3.z().c(), var3.X());
      } else {
         var11 = var3.g();
         var12 = var3.I();
         var8 = var7.b(2, var5);
         var13 = zia.a(var3.z().d(), var3.X());
      }

      float var14 = 0.0F;
      if (!var12.p()) {
         var14 = (float)var2.d() + (float)var12.z() / (float)(var12.z() - var12.D()) * (float)var2.f();
      } else {
         var14 = (float)var2.j() - (float)var12.z() / (float)(var12.z() - var12.D()) * (float)var2.f();
      }

      double var15 = var12.D();
      double var17 = var12.z();
      ArrayList var19 = new ArrayList();
      int var20 = var13.size();
      int var21 = var11.j();
      int var22 = (int)var11.D();
      int var23 = (int)var11.z();
      float var24 = 0.0F;
      if (!var11.f() && !var3.u()) {
         var24 = (float)zbr.a(var21, var23, var22, var3.X());
         if (var24 == 0.0F) {
            var24 = 1.0F;
         }

         if (var11.u) {
            var24 += 0.5F;
         }
      } else {
         var24 = (float)(zbr.a(var21, var23, var22, var3.X()) + 1);
      }

      double var25 = (double)var2.e() / (double)var24;
      ArrayList var27 = new ArrayList();

      for(int var28 = 0; var28 < var20; ++var28) {
         zje var29 = var1.E().b(var28);
         float var30 = (float)(var25 / (double)((float)var8 - var9 * (float)(var8 - 1) + var10));
         float var31 = var30 * var9;
         float var32 = var30 * var10;
         int var33 = com.aspose.cells.b.a.zo.a(com.aspose.cells.b.a.zr.a(var13.get(var28)));
         var33 = zbr.a(var21, var33, var3.X());
         int var34 = zbr.a(var21, var33, var22, var3.X());
         float var35 = (float)(var25 * (double)var34);
         if (!var11.f() && !var3.u()) {
            var35 -= (float)(var25 / 2.0D);
         }

         float var36 = 0.0F;
         if (var11.p()) {
            var36 = (float)(var2.c() + var2.e()) - var35 - var32 / 2.0F - var30 - 1.0F;
         } else {
            var36 = (float)var2.c() + var35 + var32 / 2.0F + 1.0F;
         }

         List var37 = var7.a(var4, new int[]{var5});
         int var38 = var7.a(var1, var4, new int[]{var5});
         if (var38 == -1) {
            return var19;
         }

         int var39 = var1.aj();
         if (var11.p()) {
            var36 -= (float)var38 * (var30 - var31);
         } else {
            var36 += (float)var38 * (var30 - var31);
         }

         ArrayList var40 = new ArrayList();
         if (var29 != null) {
            double var41 = var29.v();
            double var43 = var41;
            double var45 = 0.0D;
            int var47;
            zje var48;
            double var49;
            if (var41 >= 0.0D) {
               for(var47 = 0; var47 < var38; ++var47) {
                  var48 = ((zbcq)var37.get(var47)).E().b(var28);
                  if (var48 != null) {
                     var49 = var48.v();
                     if (var49 > 0.0D) {
                        var43 += var49;
                     }
                  }
               }
            } else {
               for(var47 = 0; var47 < var38; ++var47) {
                  var48 = ((zbcq)var37.get(var47)).E().b(var28);
                  if (var48 != null) {
                     var49 = var48.v();
                     if (var49 <= 0.0D) {
                        var43 += var49;
                     }
                  }
               }
            }

            for(var47 = 0; var47 < var37.size(); ++var47) {
               var48 = ((zbcq)var37.get(var47)).E().b(var28);
               if (var48 != null) {
                  var49 = var48.v();
                  var45 += Math.abs(var49);
               }
            }

            if (var45 == 0.0D || var45 == 0.0D) {
               continue;
            }

            float var61 = (float)(Math.abs(var41) * 100.0D / var45 / (var12.z() - var12.D()) * (double)var2.f());
            float var62 = (float)(Math.abs(var43) * 100.0D / var45 / (var12.z() - var12.D()) * (double)var2.f());
            boolean var63 = false;
            if (var61 == 0.0F) {
               var63 = true;
            }

            zsq var50 = var1.x();
            if (var50 != null && var50.d() != 2) {
               com.aspose.cells.b.a.b.zo var51 = new com.aspose.cells.b.a.b.zo(var36 + var30 / 2.0F, var14);
               double var52 = 0.0D;
               double var54 = 0.0D;
               float var56 = 0.0F;
               float var57 = 0.0F;
               if (var50 != null) {
                  switch(var50.g()) {
                  case 0:
                     double var58 = var50.e().size() > var28 ? var50.a(var50.e().get(var28)) : 0.0D;
                     var52 = var58;
                     var58 = var50.f().size() > var28 ? var50.a(var50.f().get(var28)) : 0.0D;
                     var54 = var58;
                     break;
                  case 1:
                     var52 = var50.c();
                     var54 = var52;
                     break;
                  case 2:
                     var52 = var50.c() * var41 / 100.0D;
                     var54 = -var52;
                  }

                  var54 = var54 * 100.0D / var45;
                  var52 = var52 * 100.0D / var45;
                  var56 = (float)var52 / (float)(var12.z() - var12.D()) * (float)var2.f();
                  var57 = (float)var54 / (float)(var12.z() - var12.D()) * (float)var2.f();
                  if (!var12.p()) {
                     if (var41 <= 0.0D) {
                        var51.b(var51.e() + var62);
                     } else {
                        var51.b(var51.e() - var62);
                     }
                  } else if (var41 <= 0.0D) {
                     var51.b(var51.e() - var62);
                  } else {
                     var51.b(var51.e() + var62);
                  }
               }

               var50.a(var51, var56, var57);
            }

            if (!var12.p()) {
               if (var41 < 0.0D) {
                  var62 = var14 + var62 - var61;
               } else {
                  var62 = var14 - var62;
               }
            } else if (var41 < 0.0D) {
               var62 = var14 - var62;
            } else {
               var62 = var14 + var62 - var61;
            }

            if (var29.k().g()) {
               --var61;
            }

            com.aspose.cells.b.a.b.zq var64 = new com.aspose.cells.b.a.b.zq(var36, var62, var30, var61 + 1.0F);
            com.aspose.cells.b.a.b.zq var65 = new com.aspose.cells.b.a.b.zq(var64.f(), var64.g(), var64.h(), var64.i());
            if (var64.g() < (float)var2.d()) {
               var64.d(var64.i() - ((float)var2.d() - var64.g()));
               var64.b((float)var2.d());
            }

            if (var64.m() > (float)(var2.j() + 1)) {
               var64.d(var64.i() - (var64.m() - (float)var2.j()));
            }

            if (var64.l() >= (float)var2.c() && var64.j() <= (float)var2.i()) {
               if (var64.f() < (float)var2.c()) {
                  var64.c(var64.h() - ((float)var2.c() - var64.f()));
                  var64.a((float)var2.c());
               } else if (var64.l() > (float)var2.i()) {
                  var64.c(var64.h() - (var64.l() - (float)var2.i()));
               }

               if (var64.h() + 1.0F >= (var30 - 1.0F) / 3.0F) {
                  if (!var63) {
                     a(var0, var29, var64, var14, var12, var2);
                  }

                  Object[] var53 = new Object[5];
                  boolean var66;
                  if (var64.g() + var64.i() / 2.0F < var14) {
                     var66 = true;
                  } else if (var41 != 0.0D) {
                     var66 = false;
                  } else if (var12.p()) {
                     var66 = false;
                  } else {
                     var66 = true;
                  }

                  var53[0] = var39;
                  var53[1] = var28;
                  var53[2] = var65;
                  var53[3] = var11;
                  var53[4] = var66;
                  if (!var29.a()) {
                     com.aspose.cells.b.a.a.ze.a(var19, (Object)var53);
                  }

                  if (var1.Y()) {
                     com.aspose.cells.b.a.a.ze.a(var40, (Object)var64);
                     com.aspose.cells.b.a.a.ze.a(var40, (Object)var66);
                  }
               }
            }
         }

         ArrayList[] var60 = new ArrayList[]{var27};
         a(var0, var1, var60, var40);
         var27 = var60[0];
      }

      return var19;
   }

   static ArrayList b(zn var0, zbcq var1, com.aspose.cells.b.a.b.zp var2, float var3, int var4) throws Exception {
      zig var5 = var1.v();
      int[] var6 = new int[]{39, 42};
      int var7 = var1.ag();
      zbp var8;
      zbp var9;
      if (var7 == 1) {
         var9 = var5.e();
         var8 = var5.G();
      } else {
         var9 = var5.g();
         var8 = var5.I();
      }

      if (var9.k() == 2) {
         return b(var0, var1, var2, var3);
      } else {
         float var10 = 0.0F;
         if (!var8.p()) {
            var10 = (float)var2.d() + (float)var8.z() / (float)(var8.z() - var8.D()) * (float)var2.f();
         } else {
            var10 = (float)var2.j() - (float)var8.z() / (float)(var8.z() - var8.D()) * (float)var2.f();
         }

         zbcs var11 = var5.z();
         int var12 = var11.getCount();
         float var13 = (float)var1.K() / 100.0F;
         double var14 = var8.D();
         double var16 = var8.z();
         boolean var18 = var1.M();
         zalw var19 = var1.P();
         zalw var20 = var1.Q();
         zix var21 = var1.T();
         zix var22 = var1.U();
         ArrayList var23 = new ArrayList();
         float var24 = 0.0F;
         int var25 = var4;
         if (var9.p) {
            var25 = (int)var9.z();
         }

         if (!var9.f() && !var5.u()) {
            var24 = (float)(var25 - 1);
            if (var24 == 0.0F) {
               var24 = 1.0F;
            }

            if (var9.u) {
               var24 += 0.5F;
            }
         } else {
            var24 = (float)var25;
         }

         double var26 = (double)var2.e() / (double)var24;
         ArrayList var28 = new ArrayList();
         ArrayList var29 = new ArrayList();
         List var30 = var11.a(var7, var6);

         int var31;
         for(var31 = 0; var31 < var30.size(); ++var31) {
            zbcq var32 = (zbcq)var30.get(var31);
            if ((!var5.an() || var32.equals(var1)) && (var1.O() || var1.N() || var32.equals(var1))) {
               int var33 = var11.a(var32, var7, var6);
               int var34 = var32.aj();
               ArrayList var35 = new ArrayList();
               zjg var36 = var32.E();

               for(int var37 = 0; var37 < var4; ++var37) {
                  zje var38 = var36.b(var37);
                  if (var38 != null && !var38.a()) {
                     double var39 = (double)((float)var26 * (float)var37 + 1.0F);
                     if (var9.f() || var5.u()) {
                        var39 += (double)((float)(var26 / 2.0D));
                     }

                     if (var9.p()) {
                        var39 = (double)(var2.c() + var2.e()) - var39;
                     } else {
                        var39 += (double)var2.c();
                     }

                     double var41 = var38.v();
                     double var43 = var41;
                     double var45 = 0.0D;
                     int var47;
                     zje var48;
                     double var49;
                     if (var41 >= 0.0D) {
                        for(var47 = 0; var47 < var33; ++var47) {
                           var48 = ((zbcq)var30.get(var47)).E().b(var37);
                           if (var48 != null) {
                              var49 = var48.v();
                              if (var49 > 0.0D) {
                                 var43 += var49;
                              }
                           }
                        }
                     } else {
                        for(var47 = 0; var47 < var33; ++var47) {
                           var48 = ((zbcq)var30.get(var47)).E().b(var37);
                           if (var48 != null) {
                              var49 = var48.v();
                              if (var49 <= 0.0D) {
                                 var43 += var49;
                              }
                           }
                        }
                     }

                     for(var47 = 0; var47 < var30.size(); ++var47) {
                        var48 = ((zbcq)var30.get(var47)).E().b(var37);
                        if (var48 != null) {
                           var49 = var48.v();
                           var45 += Math.abs(var49);
                        }
                     }

                     if (var45 != 0.0D) {
                        float var69 = (float)Math.abs(var43) * 100.0F / (float)var45 / (float)(var8.z() - var8.D()) * (float)var2.f();
                        zsq var70 = var1.x();
                        com.aspose.cells.b.a.b.zo var71;
                        if (var70 != null && var70.d() != 2 && var32.equals(var1)) {
                           var71 = new com.aspose.cells.b.a.b.zo((float)var39, var10);
                           double var50 = 0.0D;
                           double var52 = 0.0D;
                           float var54 = 0.0F;
                           float var55 = 0.0F;
                           if (var70 != null) {
                              switch(var70.g()) {
                              case 0:
                                 double var56 = var70.e().size() > var37 ? var70.a(var70.e().get(var37)) : 0.0D;
                                 var50 = var56;
                                 var56 = var70.f().size() > var37 ? var70.a(var70.f().get(var37)) : 0.0D;
                                 var52 = var56;
                                 break;
                              case 1:
                                 var50 = var70.c();
                                 var52 = var50;
                                 break;
                              case 2:
                                 var50 = var70.c() * var41 / 100.0D;
                                 var52 = -var50;
                              }

                              var52 = var52 * 100.0D / var45;
                              var50 = var50 * 100.0D / var45;
                              var54 = (float)var50 / (float)(var8.z() - var8.D()) * (float)var2.f();
                              var55 = (float)var52 / (float)(var8.z() - var8.D()) * (float)var2.f();
                              if (!var8.p()) {
                                 if (var41 < 0.0D) {
                                    var71.b(var71.e() + var69);
                                 } else {
                                    var71.b(var71.e() - var69);
                                 }
                              } else if (var41 < 0.0D) {
                                 var71.b(var71.e() - var69);
                              } else {
                                 var71.b(var71.e() + var69);
                              }
                           }

                           if (var32.equals(var1)) {
                              var70.a(var71, var54, var55);
                           }
                        }

                        if (!var8.p()) {
                           if (var41 < 0.0D) {
                              var69 += var10;
                           } else {
                              var69 = var10 - var69;
                           }
                        } else if (var41 < 0.0D) {
                           var69 = var10 - var69;
                        } else {
                           var69 += var10;
                        }

                        var71 = new com.aspose.cells.b.a.b.zo((float)var39, var69);
                        com.aspose.cells.b.a.a.ze.a(var35, (Object)var71);
                        if (var32.equals(var1)) {
                           if (var18) {
                              var19.a((float)var39, var69, (float)var39, var3);
                           }

                           com.aspose.cells.b.a.a.ze.a(var29, (Object)var71);
                           Object[] var72 = new Object[]{var34, var37, var71, var9};
                           com.aspose.cells.b.a.a.ze.a(var23, (Object)var72);
                        }
                     }
                  } else {
                     com.aspose.cells.b.a.a.ze.a(var35, (Object)null);
                     if (var32.equals(var1)) {
                        com.aspose.cells.b.a.a.ze.a(var29, (Object)null);
                     }
                  }
               }

               if (var32.equals(var1)) {
                  a(var0, var32, var35, var2);
               }

               com.aspose.cells.b.a.a.ze.a(var28, (Object)var35);
            }
         }

         if (!var5.an()) {
            for(var31 = 0; var31 < var4; ++var31) {
               boolean var58 = false;
               boolean var59 = false;
               float var60 = 0.0F;
               float var61 = 0.0F;
               float var62 = 0.0F;
               boolean var63 = false;
               boolean var64 = false;
               float var66 = 0.0F;
               float var40 = 0.0F;

               int var65;
               for(var65 = 0; var65 < var28.size(); ++var65) {
                  ArrayList var42 = (ArrayList)var28.get(var65);
                  if (var42.size() > var31 && var42.get(var31) != null) {
                     com.aspose.cells.b.a.b.zo var68 = (com.aspose.cells.b.a.b.zo)var42.get(var31);
                     var62 = var68.d();
                     if (!var58) {
                        var60 = var68.e();
                        var58 = true;
                     } else if (!var59) {
                        if (var60 < var68.e()) {
                           var61 = var60;
                           var60 = var68.e();
                           var59 = true;
                        } else {
                           var61 = var68.e();
                           var59 = true;
                        }
                     } else {
                        if (var60 < var68.e()) {
                           var60 = var68.e();
                        }

                        if (var61 > var68.e()) {
                           var61 = var68.e();
                        }
                     }

                     if (var65 == 0) {
                        var66 = var68.e();
                        var63 = true;
                     } else if (var65 == var28.size() - 1) {
                        var40 = var68.e();
                        var64 = true;
                     }
                  }
               }

               if (var1.N() && var58 && var59) {
                  var20.a(var62, var60, var62, var61);
               }

               if (var1.O() && var63 && var64) {
                  var65 = (int)(var26 / (double)(1.0F + var13));
                  com.aspose.cells.b.a.b.zq var67 = new com.aspose.cells.b.a.b.zq();
                  if (var66 <= var40) {
                     var67.c((float)var65);
                     var67.d(var40 - var66);
                     var67.a(var62 - var67.h() / 2.0F);
                     var67.b(var66);
                     a(var0, var22, var67);
                  } else {
                     var67.c((float)var65);
                     var67.d(var66 - var40);
                     var67.a(var62 - var67.h() / 2.0F);
                     var67.b(var40);
                     a(var0, var21, var67);
                  }
               }
            }
         }

         if (!var5.an()) {
            zbvw.a(var0, var1, var29, var2);
         }

         return var23;
      }
   }

   private static ArrayList b(zn var0, zbcq var1, com.aspose.cells.b.a.b.zp var2, float var3) throws Exception {
      zig var4 = var1.v();
      int[] var5 = new int[]{39, 42};
      int var6 = var1.ag();
      zbcs var7 = var4.z();
      int var8 = var7.getCount();
      float var9 = (float)var1.L() / 100.0F;
      float var10 = (float)var1.K() / 100.0F;
      zbp var11;
      zbp var12;
      ArrayList var13;
      if (var6 == 1) {
         var12 = var4.e();
         var11 = var4.G();
         var13 = zia.a(var4.z().c(), var4.X());
      } else {
         var12 = var4.g();
         var11 = var4.I();
         var13 = zia.a(var4.z().d(), var4.X());
      }

      float var14 = 0.0F;
      if (!var11.p()) {
         var14 = (float)var2.d() + (float)var11.z() / (float)(var11.z() - var11.D()) * (float)var2.f();
      } else {
         var14 = (float)var2.j() - (float)var11.z() / (float)(var11.z() - var11.D()) * (float)var2.f();
      }

      double var15 = var11.D();
      double var17 = var11.z();
      boolean var19 = var1.M();
      zalw var20 = var1.P();
      zalw var21 = var1.Q();
      zix var22 = var1.T();
      zix var23 = var1.U();
      int var24 = var13.size();
      int var25 = var12.j();
      int var26 = (int)var12.D();
      int var27 = (int)var12.z();
      float var28 = 0.0F;
      if (!var12.f() && !var4.u()) {
         var28 = (float)zbr.a(var25, var27, var26, var4.X());
         if (var28 == 0.0F) {
            var28 = 1.0F;
         }

         if (var12.u) {
            var28 += 0.5F;
         }
      } else {
         var28 = (float)(zbr.a(var25, var27, var26, var4.X()) + 1);
      }

      double var29 = (double)var2.e() / (double)var28;
      float var31 = 0.0F;
      ArrayList var32 = new ArrayList();
      ArrayList var33 = new ArrayList();
      ArrayList var34 = new ArrayList();
      List var35 = var7.a(var6, var5);

      int var36;
      float var45;
      for(var36 = 0; var36 < var35.size(); ++var36) {
         zbcq var37 = (zbcq)var35.get(var36);
         if ((!var4.an() || var37.equals(var1)) && (var1.O() || var1.N() || var37.equals(var1))) {
            int var38 = var7.a(var37, var6, var5);
            int var39 = var37.aj();
            ArrayList var40 = new ArrayList();

            for(int var41 = 0; var41 < var24; ++var41) {
               zje var42 = var37.E().b(var41);
               if (var42 != null && !var42.a()) {
                  int var43 = com.aspose.cells.b.a.zo.a(com.aspose.cells.b.a.zr.a(var13.get(var41)));
                  var43 = zbr.a(var25, var43, var4.X());
                  int var44 = zbr.a(var25, var43, var26, var4.X());
                  var45 = (float)(var29 * (double)var44);
                  var31 = (float)(var29 * (double)zbr.a(var25, zbr.a(var12.j(), var12.y(), (int)var12.x(), var43, var4.X()), var43, var4.X()));
                  if (var12.f() || var4.u()) {
                     var45 += (float)(var29 / 2.0D);
                  }

                  float var46 = 0.0F;
                  if (var12.p()) {
                     var46 = (float)(var2.c() + var2.e()) - var45;
                  } else {
                     var46 = (float)var2.c() + var45;
                  }

                  double var47 = var42.v();
                  double var49 = var47;
                  double var51 = 0.0D;
                  int var53;
                  zje var54;
                  double var55;
                  if (var47 >= 0.0D) {
                     for(var53 = 0; var53 < var38; ++var53) {
                        var54 = ((zbcq)var35.get(var53)).E().b(var41);
                        if (var54 != null) {
                           var55 = var54.v();
                           if (var55 > 0.0D) {
                              var49 += var55;
                           }
                        }
                     }
                  } else {
                     for(var53 = 0; var53 < var38; ++var53) {
                        var54 = ((zbcq)var35.get(var53)).E().b(var41);
                        if (var54 != null) {
                           var55 = var54.v();
                           if (var55 <= 0.0D) {
                              var49 += var55;
                           }
                        }
                     }
                  }

                  for(var53 = 0; var53 < var35.size(); ++var53) {
                     var54 = ((zbcq)var35.get(var53)).E().b(var41);
                     if (var54 != null) {
                        var55 = var54.v();
                        var51 += Math.abs(var55);
                     }
                  }

                  if (var51 != 0.0D) {
                     float var75 = (float)Math.abs(var49) * 100.0F / (float)var51 / (float)(var11.z() - var11.D()) * (float)var2.f();
                     zsq var76 = var1.x();
                     com.aspose.cells.b.a.b.zo var77;
                     if (var76 != null && var76.d() != 2 && var37.equals(var1)) {
                        var77 = new com.aspose.cells.b.a.b.zo(var46, var14);
                        double var56 = 0.0D;
                        double var58 = 0.0D;
                        float var60 = 0.0F;
                        float var61 = 0.0F;
                        switch(var76.g()) {
                        case 0:
                           double var62 = var76.e().size() > var41 ? var76.a(var76.e().get(var41)) : 0.0D;
                           var56 = var62;
                           var62 = var76.f().size() > var41 ? var76.a(var76.f().get(var41)) : 0.0D;
                           var58 = var62;
                           break;
                        case 1:
                           var56 = var76.c();
                           var58 = var56;
                           break;
                        case 2:
                           var56 = var76.c() * var47 / 100.0D;
                           var58 = -var56;
                        }

                        var58 = var58 * 100.0D / var51;
                        var56 = var56 * 100.0D / var51;
                        var60 = (float)var56 / (float)(var11.z() - var11.D()) * (float)var2.f();
                        var61 = (float)var58 / (float)(var11.z() - var11.D()) * (float)var2.f();
                        if (!var11.p()) {
                           if (var47 < 0.0D) {
                              var77.b(var77.e() + var75);
                           } else {
                              var77.b(var77.e() - var75);
                           }
                        } else if (var47 < 0.0D) {
                           var77.b(var77.e() - var75);
                        } else {
                           var77.b(var77.e() + var75);
                        }

                        var76.a(var77, var60, var61);
                     }

                     if (!var11.p()) {
                        if (var47 < 0.0D) {
                           var75 += var14;
                        } else {
                           var75 = var14 - var75;
                        }
                     } else if (var47 < 0.0D) {
                        var75 = var14 - var75;
                     } else {
                        var75 += var14;
                     }

                     var77 = new com.aspose.cells.b.a.b.zo(var46, var75);
                     if (var40.size() == 0) {
                        com.aspose.cells.b.a.a.ze.a(var40, (Object)var77);
                     } else {
                        a(var77, var40, var12.p());
                     }

                     if (var37.equals(var1)) {
                        if (var19) {
                           var20.a(var46, var75, var46, var3);
                        }

                        com.aspose.cells.b.a.a.ze.a(var34, (Object)var77);
                        Object[] var78 = new Object[]{var39, var41, var77, var12};
                        com.aspose.cells.b.a.a.ze.a(var32, (Object)var78);
                     }
                  }
               } else {
                  if (var12.p()) {
                     var40.add(0, (Object)null);
                  } else {
                     com.aspose.cells.b.a.a.ze.a(var40, (Object)null);
                  }

                  if (var37.equals(var1)) {
                     com.aspose.cells.b.a.a.ze.a(var34, (Object)null);
                  }
               }
            }

            if (var37.equals(var1)) {
               a(var0, var37, var40, var2);
            }

            com.aspose.cells.b.a.a.ze.a(var33, (Object)var40);
         }
      }

      if (!var4.an()) {
         for(var36 = 0; var36 < var24; ++var36) {
            boolean var64 = false;
            boolean var65 = false;
            float var66 = 0.0F;
            float var67 = 0.0F;
            float var68 = 0.0F;
            boolean var69 = false;
            boolean var70 = false;
            float var71 = 0.0F;
            var45 = 0.0F;

            int var73;
            for(var73 = 0; var73 < var33.size(); ++var73) {
               ArrayList var72 = (ArrayList)var33.get(var73);
               if (var72.size() > var36 && var72.get(var36) != null) {
                  com.aspose.cells.b.a.b.zo var48 = (com.aspose.cells.b.a.b.zo)var72.get(var36);
                  var68 = var48.d();
                  if (!var64) {
                     var66 = var48.e();
                     var64 = true;
                  } else if (!var65) {
                     if (var66 < var48.e()) {
                        var67 = var66;
                        var66 = var48.e();
                        var65 = true;
                     } else {
                        var67 = var48.e();
                        var65 = true;
                     }
                  } else {
                     if (var66 < var48.e()) {
                        var66 = var48.e();
                     }

                     if (var67 > var48.e()) {
                        var67 = var48.e();
                     }
                  }

                  if (var73 == 0) {
                     var71 = var48.e();
                     var69 = true;
                  } else if (var73 == var33.size() - 1) {
                     var45 = var48.e();
                     var70 = true;
                  }
               }
            }

            if (var1.N() && var64 && var65) {
               var21.a(var68, var66, var68, var67);
            }

            if (var1.O() && var69 && var70) {
               var73 = (int)(var31 / (1.0F + var10));
               com.aspose.cells.b.a.b.zq var74 = new com.aspose.cells.b.a.b.zq();
               if (var71 <= var45) {
                  var74.c((float)var73);
                  var74.d(var45 - var71);
                  var74.a(var68 - var74.h() / 2.0F);
                  var74.b(var71);
                  a(var0, var23, var74);
               } else {
                  var74.c((float)var73);
                  var74.d(var71 - var45);
                  var74.a(var68 - var74.h() / 2.0F);
                  var74.b(var45);
                  a(var0, var22, var74);
               }
            }
         }
      }

      if (!var4.an()) {
         zbvw.a(var0, var1, var34, var2);
      }

      return var32;
   }

   static ArrayList a(zn var0, zig var1, float var2, double var3, int var5) throws Exception {
      zbcs var6 = var1.z();
      int var7 = var6.getCount();
      zbp var8 = var1.G();
      zbp var9 = var1.e();
      if (var9.k() == 2) {
         return a(var0, var1, var2, var3);
      } else {
         ArrayList var10 = new ArrayList();
         float var11 = var1.S().g() / (float)var5;
         float var12 = var1.S().a(false, var5, var7);
         float var13 = var1.S().k();
         float var14 = var12 * (float)var1.o() / 100.0F;

         for(int var15 = 0; var15 < var5; ++var15) {
            int var16 = var15;
            if (var1.E() > 180) {
               var16 = var5 - 1 - var15;
            }

            ArrayList var17 = var6.j();
            double var18 = 1.0D;

            for(int var20 = 0; var20 < var17.size(); ++var20) {
               int var21 = var20;
               if (var1.E() > 180) {
                  var21 = var17.size() - 1 - var20;
               }

               zbcq var22 = (zbcq)var17.get(var21);
               int var23 = var22.aj();
               float var24 = (float)var21 * var12;
               float var25 = var11 * (float)var16 + var14 / 2.0F + var24;
               var25 += var1.S().e();
               zjg var26 = var22.E();
               int var27 = var16;
               if (var9.p()) {
                  var27 = var5 - 1 - var16;
               }

               zje var28 = var26.b(var27);
               if (var28 != null && !var28.a()) {
                  double var29 = var8.i(var28.v());
                  float var31 = (float)(zbuk.a(var3, var29) / (var8.z() - var8.D()) * (double)var1.S().i());
                  if (var8.p()) {
                     var31 = -var31;
                  }

                  double[] var32 = new double[]{var18};
                  a(var0, var28, var1, var25, var12, var13, var2, var31, Double.NaN, var32);
                  var18 = var32[0];
                  boolean var33 = true;
                  if (zbuk.a((double)var31, 0.0D) <= 0.0D) {
                     var33 = true;
                  } else {
                     var33 = false;
                  }

                  com.aspose.cells.b.a.b.zo var34 = a(var1, var25, var12, var13, var2, var31, var33);
                  Object[] var35 = new Object[]{var23, var27, var34, var33};
                  com.aspose.cells.b.a.a.ze.a(var10, (Object)var35);
               }
            }
         }

         return var10;
      }
   }

   private static ArrayList a(zn var0, zig var1, float var2, double var3) throws Exception {
      zbcs var5 = var1.z();
      int var6 = var5.getCount();
      zbp var7 = var1.G();
      zbp var8 = var1.e();
      ArrayList var9 = new ArrayList();
      int var10 = (int)var8.z();
      int var11 = (int)var8.D();
      int var12 = var8.j();
      int var13 = zbr.a(var12, var10, var11, var1.X()) + 1;
      float var14 = var1.S().g() / (float)var13;
      float var15 = var1.S().a(false, var13, var6);
      float var16 = var1.S().k();
      float var17 = var15 * (float)var1.o() / 100.0F;
      ArrayList var18 = zia.a(var1.z().c(), var1.X());
      int var19 = var18.size();

      for(int var20 = 0; var20 < var19; ++var20) {
         int var21 = var20;
         if (var1.E() > 180) {
            var21 = var19 - 1 - var20;
         }

         int var22 = com.aspose.cells.b.a.zo.a(com.aspose.cells.b.a.zr.a(var18.get(var21)));
         var22 = zbr.a(var12, var22, var1.X());
         int var23 = zbr.a(var12, var22, (int)var8.D(), var1.X());
         float var24 = var14 * (float)var23;
         var24 += var1.S().e() + var17 / 2.0F;
         ArrayList var25 = var5.j();
         double var26 = 1.0D;

         for(int var28 = 0; var28 < var25.size(); ++var28) {
            int var29 = var28;
            if (var1.E() > 180) {
               var29 = var25.size() - 1 - var28;
            }

            zbcq var30 = (zbcq)var25.get(var29);
            int var31 = var30.aj();
            float var32 = (float)var29 * var15;
            float var33 = var24 + var32;
            zjg var34 = var30.E();
            int var35 = var21;
            if (var8.p()) {
               var35 = var19 - 1 - var21;
            }

            zje var36 = var34.b(var35);
            if (var36 != null && !var36.a()) {
               double var37 = var7.i(var36.v());
               float var39 = (float)(zbuk.a(var3, var37) / (var7.z() - var7.D()) * (double)var1.S().i());
               if (var7.p()) {
                  var39 = -var39;
               }

               double[] var40 = new double[]{var26};
               a(var0, var36, var1, var33, var15, var16, var2, var39, Double.NaN, var40);
               var26 = var40[0];
               boolean var41 = true;
               if (zbuk.a((double)var39, 0.0D) < 0.0D) {
                  var41 = true;
               } else {
                  var41 = false;
               }

               com.aspose.cells.b.a.b.zo var42 = a(var1, var33, var15, var16, var2, var39, var41);
               Object[] var43 = new Object[]{var31, var35, var42, var41};
               com.aspose.cells.b.a.a.ze.a(var9, (Object)var43);
            }
         }
      }

      return var9;
   }

   static ArrayList a(zn var0, zig var1, double var2, int var4) throws Exception {
      zbcs var5 = var1.z();
      int var6 = var5.getCount();
      zbp var7 = var1.G();
      zbp var8 = var1.e();
      ArrayList var9 = var5.j();
      int var10 = zia.a(var9);
      double var11 = 0.0D;
      if (var10 == 1) {
         var11 = var7.D();
      } else if (var10 == 2) {
         var11 = var7.z();
      }

      float var13 = 0.0F;
      if (var1.G().p()) {
         var13 = var1.S().f() - (float)Math.abs((var7.z() - var11) / (double)((float)(var7.z() - var7.D()))) * var1.S().i();
      } else {
         var13 = var1.S().f() - (float)Math.abs((var7.D() - var11) / (double)((float)(var7.z() - var7.D()))) * var1.S().i();
      }

      if (var8.k() == 2) {
         return a(var0, var1, var13, var2, var10, var11);
      } else {
         ArrayList var14 = new ArrayList();
         float var15 = var1.S().g() / (float)var4;
         float var16 = var1.S().a(false, var4, 1);
         float var17 = var1.S().k();
         float var18 = var16 * (float)var1.o() / 100.0F;

         for(int var19 = 0; var19 < var4; ++var19) {
            int var20 = var19;
            if (var1.E() > 180) {
               var20 = var4 - 1 - var19;
            }

            float var21 = var1.S().e() + var15 * (float)var20 + var18 / 2.0F;
            ArrayList var22 = new ArrayList();

            int var25;
            for(int var23 = 0; var23 < var9.size(); ++var23) {
               zbcq var24 = (zbcq)var9.get(var23);
               var25 = var24.aj();
               zjg var26 = var24.E();
               int var27 = var20;
               if (var8.p()) {
                  var27 = var4 - 1 - var20;
               }

               zje var28 = var26.b(var27);
               if (var28 != null && !var28.a()) {
                  double var30 = var28.v();
                  double var32 = 0.0D;
                  double[] var34 = new double[]{var30};
                  double[] var35 = new double[]{var32};
                  boolean var36 = zjl.a(var34, var35, var9, var23, var27, var7.z(), var7.D());
                  var30 = var34[0];
                  var32 = var35[0];
                  if (var36) {
                     if (var10 == 1 && var23 == 0) {
                        var30 -= var11;
                     } else if (var10 == 2 && var23 == 0) {
                        var30 -= var11;
                     }

                     float var37 = (float)(var30 / (var7.z() - var7.D()) * (double)var1.S().i());
                     float var38 = (float)((var32 - var11) / (var7.z() - var7.D()) * (double)var1.S().i());
                     float var39;
                     if (var7.p()) {
                        var39 = var13 + (var38 - var37);
                     } else {
                        var39 = var13 - (var38 - var37);
                        var37 = -var37;
                     }

                     float var40 = var39 + var37;
                     if (var39 > var1.S().f()) {
                        var39 = var1.S().f();
                     }

                     if (var39 < var1.S().f() - var1.S().i()) {
                        var39 = var1.S().f() - var1.S().i();
                     }

                     if (var40 > var1.S().f()) {
                        var40 = var1.S().f();
                     }

                     if (var40 < var1.S().f() - var1.S().i()) {
                        var40 = var1.S().f() - var1.S().i();
                     }

                     var37 = var40 - var39;
                     Object[] var41 = new Object[]{var28, var21, var39, var37, var32};
                     a(var30, var41, var22, var7);
                     com.aspose.cells.b.a.b.zo var42 = a(var1, var21, var16, var17, var39, var37);
                     Object[] var43 = new Object[]{var25, var27, var42};
                     com.aspose.cells.b.a.a.ze.a(var14, (Object)var43);
                  }
               }
            }

            double var44 = 1.0D;

            for(var25 = 0; var25 < var22.size(); ++var25) {
               Object[] var45 = (Object[])((Object[])var22.get(var25));
               zje var46 = (zje)var45[0];
               double[] var47 = new double[]{var44};
               a(var0, var46, var1, (Float)var45[1], var16, var17, (Float)var45[2], (Float)var45[3], (Double)var45[4], var47);
               var44 = var47[0];
            }

            var22.clear();
         }

         return var14;
      }
   }

   private static ArrayList a(zn var0, zig var1, float var2, double var3, int var5, double var6) throws Exception {
      zbcs var8 = var1.z();
      int var9 = var8.getCount();
      zbp var10 = var1.G();
      zbp var11 = var1.e();
      ArrayList var12 = new ArrayList();
      int var13 = (int)var11.z();
      int var14 = (int)var11.D();
      int var15 = var11.j();
      int var16 = zbr.a(var15, var13, var14, var1.X()) + 1;
      float var17 = var1.S().g() / (float)var16;
      float var18 = var1.S().a(false, var16, 1);
      float var19 = var1.S().k();
      float var20 = var18 * (float)var1.o() / 100.0F;
      ArrayList var21 = zia.a(var1.z().c(), var1.X());
      int var22 = var21.size();

      for(int var23 = 0; var23 < var22; ++var23) {
         int var24 = var23;
         if (var1.E() > 180) {
            var24 = var22 - 1 - var23;
         }

         int var25 = com.aspose.cells.b.a.zo.a(com.aspose.cells.b.a.zr.a(var21.get(var24)));
         var25 = zbr.a(var15, var25, var1.X());
         int var26 = zbr.a(var15, var25, (int)var11.D(), var1.X());
         float var27 = var17 * (float)var26;
         float var28 = var1.S().e() + var20 / 2.0F + var27;
         ArrayList var29 = new ArrayList();
         ArrayList var30 = var8.j();

         int var33;
         for(int var31 = 0; var31 < var30.size(); ++var31) {
            zbcq var32 = (zbcq)var30.get(var31);
            var33 = var32.aj();
            zjg var34 = var32.E();
            int var35 = var24;
            if (var11.p()) {
               var35 = var22 - 1 - var24;
            }

            zje var36 = var34.b(var35);
            if (var36 != null && !var36.a()) {
               double var38 = var36.v();
               double var40 = 0.0D;
               double[] var42 = new double[]{var38};
               double[] var43 = new double[]{var40};
               boolean var44 = zjl.a(var42, var43, var30, var31, var35, var10.z(), var10.D());
               var38 = var42[0];
               var40 = var43[0];
               if (var44) {
                  if (var5 == 1 && var31 == 0) {
                     var38 -= var6;
                  } else if (var5 == 2 && var31 == 0) {
                     var38 -= var6;
                  }

                  float var45 = (float)(var38 / (var10.z() - var10.D()) * (double)var1.S().i());
                  float var46 = (float)((var40 - var6) / (var10.z() - var10.D()) * (double)var1.S().i());
                  float var47;
                  if (var10.p()) {
                     var47 = var2 + (var46 - var45);
                  } else {
                     var47 = var2 - (var46 - var45);
                     var45 = -var45;
                  }

                  float var48 = var47 + var45;
                  if (var47 > var1.S().f()) {
                     var47 = var1.S().f();
                  }

                  if (var47 < var1.S().f() - var1.S().i()) {
                     var47 = var1.S().f() - var1.S().i();
                  }

                  if (var48 > var1.S().f()) {
                     var48 = var1.S().f();
                  }

                  if (var48 < var1.S().f() - var1.S().i()) {
                     var48 = var1.S().f() - var1.S().i();
                  }

                  var45 = var48 - var47;
                  Object[] var49 = new Object[]{var36, var28, var47, var45, var40};
                  a(var38, var49, var29, var10);
                  com.aspose.cells.b.a.b.zo var50 = a(var1, var28, var18, var19, var47, var45);
                  Object[] var51 = new Object[]{var33, var35, var50};
                  com.aspose.cells.b.a.a.ze.a(var12, (Object)var51);
               }
            }
         }

         double var52 = 1.0D;

         for(var33 = 0; var33 < var29.size(); ++var33) {
            Object[] var53 = (Object[])((Object[])var29.get(var33));
            zje var54 = (zje)var53[0];
            double[] var55 = new double[]{var52};
            a(var0, var54, var1, (Float)var53[1], var18, var19, (Float)var53[2], (Float)var53[3], (Double)var53[4], var55);
            var52 = var55[0];
         }

         var29.clear();
      }

      return var12;
   }

   static ArrayList b(zn var0, zig var1, double var2, int var4) throws Exception {
      zbcs var5 = var1.z();
      int var6 = var5.getCount();
      zbp var7 = var1.G();
      zbp var8 = var1.e();
      float var9 = 0.0F;
      if (var1.G().p()) {
         var9 = var1.S().f() - (float)Math.abs(var7.z() / (double)((float)(var7.z() - var7.D()))) * var1.S().i();
      } else {
         var9 = var1.S().f() - var1.S().i() + (float)Math.abs(var7.z() / (double)((float)(var7.z() - var7.D()))) * var1.S().i();
      }

      if (var8.k() == 2) {
         return b(var0, var1, var9, var2);
      } else {
         ArrayList var10 = new ArrayList();
         float var11 = var1.S().g() / (float)var4;
         float var12 = var1.S().a(false, var4, 1);
         float var13 = var1.S().k();
         float var14 = var12 * (float)var1.o() / 100.0F;
         ArrayList var15 = var5.j();

         for(int var16 = 0; var16 < var4; ++var16) {
            int var17 = var16;
            if (var1.E() > 180) {
               var17 = var4 - 1 - var16;
            }

            float var18 = var1.S().e() + var11 * (float)var17 + var14 / 2.0F;
            ArrayList var19 = new ArrayList();

            int var22;
            for(int var20 = 0; var20 < var15.size(); ++var20) {
               zbcq var21 = (zbcq)var15.get(var20);
               var22 = var21.aj();
               zjg var23 = var21.E();
               int var24 = var17;
               if (var8.p()) {
                  var24 = var4 - 1 - var17;
               }

               zje var25 = var23.b(var24);
               if (var25 != null && !var25.a()) {
                  double var27 = zjl.a(var15, var24);
                  if (var27 != 0.0D) {
                     double var29 = var25.v();
                     double[] var33 = new double[]{var29};
                     double[] var34 = new double[]{var29};
                     boolean var35 = zjl.a(var33, var34, var15, var20, var24, var7, var27);
                     var29 = var33[0];
                     double var31 = var34[0];
                     if (var35) {
                        float var36 = (float)(var29 * 100.0D / var27 / (var7.z() - var7.D()) * (double)var1.S().i());
                        float var37 = (float)(var31 * 100.0D / var27 / (var7.z() - var7.D()) * (double)var1.S().i());
                        float var38;
                        if (var7.p()) {
                           var38 = var9 + (var37 - var36);
                        } else {
                           var38 = var9 - (var37 - var36);
                           var36 = -var36;
                        }

                        float var39 = var38 + var36;
                        if (var38 > var1.S().f()) {
                           var38 = var1.S().f();
                        }

                        if (var38 < var1.S().f() - var1.S().i()) {
                           var38 = var1.S().f() - var1.S().i();
                        }

                        if (var39 > var1.S().f()) {
                           var39 = var1.S().f();
                        }

                        if (var39 < var1.S().f() - var1.S().i()) {
                           var39 = var1.S().f() - var1.S().i();
                        }

                        var36 = var39 - var38;
                        Object[] var40 = new Object[]{var25, var18, var38, var36, var31};
                        a(var29, var40, var19, var7);
                        com.aspose.cells.b.a.b.zo var41 = a(var1, var18, var12, var13, var38, var36);
                        Object[] var42 = new Object[]{var22, var24, var41};
                        com.aspose.cells.b.a.a.ze.a(var10, (Object)var42);
                     }
                  }
               }
            }

            double var43 = 1.0D;

            for(var22 = 0; var22 < var19.size(); ++var22) {
               Object[] var44 = (Object[])((Object[])var19.get(var22));
               zje var45 = (zje)var44[0];
               double[] var46 = new double[]{var43};
               a(var0, var45, var1, (Float)var44[1], var12, var13, (Float)var44[2], (Float)var44[3], (Double)var44[4], var46);
               var43 = var46[0];
            }

            var19.clear();
         }

         return var10;
      }
   }

   private static ArrayList b(zn var0, zig var1, float var2, double var3) throws Exception {
      zbcs var5 = var1.z();
      int var6 = var5.getCount();
      zbp var7 = var1.G();
      zbp var8 = var1.e();
      ArrayList var9 = new ArrayList();
      int var10 = (int)var8.z();
      int var11 = (int)var8.D();
      int var12 = var8.j();
      int var13 = zbr.a(var12, var10, var11, var1.X()) + 1;
      float var14 = var1.S().g() / (float)var13;
      float var15 = var1.S().a(false, var13, 1);
      float var16 = var1.S().k();
      float var17 = var15 * (float)var1.o() / 100.0F;
      ArrayList var18 = zia.a(var1.z().c(), var1.X());
      int var19 = var18.size();

      for(int var20 = 0; var20 < var19; ++var20) {
         int var21 = var20;
         if (var1.E() > 180) {
            var21 = var19 - 1 - var20;
         }

         int var22 = com.aspose.cells.b.a.zo.a(com.aspose.cells.b.a.zr.a(var18.get(var21)));
         var22 = zbr.a(var12, var22, var1.X());
         int var23 = zbr.a(var12, var22, (int)var8.D(), var1.X());
         float var24 = var14 * (float)var23;
         float var25 = var1.S().e() + var17 / 2.0F + var24;
         ArrayList var26 = new ArrayList();
         ArrayList var27 = var5.j();

         int var30;
         for(int var28 = 0; var28 < var27.size(); ++var28) {
            zbcq var29 = (zbcq)var27.get(var28);
            var30 = var29.aj();
            zjg var31 = var29.E();
            int var32 = var21;
            if (var8.p()) {
               var32 = var19 - 1 - var21;
            }

            zje var33 = var31.b(var32);
            if (var33 != null && !var33.a()) {
               double var35 = zjl.a(var27, var32);
               if (var35 != 0.0D) {
                  double var37 = var33.v();
                  double[] var41 = new double[]{var37};
                  double[] var42 = new double[]{var37};
                  boolean var43 = zjl.a(var41, var42, var27, var28, var32, var7, var35);
                  var37 = var41[0];
                  double var39 = var42[0];
                  if (var43) {
                     float var44 = (float)(var37 * 100.0D / var35 / (var7.z() - var7.D()) * (double)var1.S().i());
                     float var45 = (float)(var39 * 100.0D / var35 / (var7.z() - var7.D()) * (double)var1.S().i());
                     float var46;
                     if (var7.p()) {
                        var46 = var2 + (var45 - var44);
                     } else {
                        var46 = var2 - (var45 - var44);
                        var44 = -var44;
                     }

                     float var47 = var46 + var44;
                     if (var46 > var1.S().f()) {
                        var46 = var1.S().f();
                     }

                     if (var46 < var1.S().f() - var1.S().i()) {
                        var46 = var1.S().f() - var1.S().i();
                     }

                     if (var47 > var1.S().f()) {
                        var47 = var1.S().f();
                     }

                     if (var47 < var1.S().f() - var1.S().i()) {
                        var47 = var1.S().f() - var1.S().i();
                     }

                     var44 = var47 - var46;
                     Object[] var48 = new Object[]{var33, var25, var46, var44, var39};
                     a(var37, var48, var26, var7);
                     com.aspose.cells.b.a.b.zo var49 = a(var1, var25, var15, var16, var46, var44);
                     Object[] var50 = new Object[]{var30, var32, var49};
                     com.aspose.cells.b.a.a.ze.a(var9, (Object)var50);
                  }
               }
            }
         }

         double var51 = 1.0D;

         for(var30 = 0; var30 < var26.size(); ++var30) {
            Object[] var52 = (Object[])((Object[])var26.get(var30));
            zje var53 = (zje)var52[0];
            double[] var54 = new double[]{var51};
            a(var0, var53, var1, (Float)var52[1], var15, var16, (Float)var52[2], (Float)var52[3], (Double)var52[4], var54);
            var51 = var54[0];
         }

         var26.clear();
      }

      return var9;
   }

   static ArrayList b(zn var0, zig var1, float var2, double var3, int var5) throws Exception {
      zbcs var6 = var1.z();
      int var7 = var6.getCount();
      zbp var8 = var1.G();
      zbp var9 = var1.e();
      if (var9.k() == 2) {
         return c(var0, var1, var2, var3);
      } else {
         float var10 = (float)var1.m() / 100.0F;
         float var11 = (float)var1.n() / 100.0F;
         float var12 = (float)var1.o() / 100.0F;
         ArrayList var13 = new ArrayList();
         float var14 = var1.S().g() / (float)var5;
         float var15 = var14 / (1.0F + var12);
         float var16 = var15 * var12;
         float var17 = var14 * var10 / (1.0F + var11);
         ArrayList var18 = var6.j();
         int var19;
         int var20;
         int var22;
         int var24;
         int var27;
         zje var28;
         double var29;
         float var31;
         boolean var32;
         com.aspose.cells.b.a.b.zo var33;
         Object[] var34;
         if ((var1.E() < 0 || var1.E() >= 90) && (var1.E() < 180 || var1.E() >= 270)) {
            if (var1.E() >= 90 && var1.E() < 180 || var1.E() >= 270 && var1.E() < 360) {
               for(var19 = 0; var19 < var5; ++var19) {
                  var20 = var19;
                  if (var1.E() >= 270 && var1.E() < 360) {
                     var20 = var5 - 1 - var19;
                  }

                  for(int var35 = 0; var35 < var18.size(); ++var35) {
                     var22 = var35;
                     if (var1.E() >= 270 && var1.E() < 360) {
                        var22 = var18.size() - 1 - var35;
                     }

                     if (var1.K().p()) {
                        var22 = var18.size() - 1 - var22;
                     }

                     zbcq var36 = (zbcq)var18.get(var22);
                     var24 = var36.aj();
                     float var37 = var14 * (float)var20 + var16 / 2.0F;
                     var37 += var1.S().e();
                     zjg var38 = var36.E();
                     var27 = var20;
                     if (var9.p()) {
                        var27 = var5 - 1 - var20;
                     }

                     var28 = var38.b(var27);
                     if (var28 != null && !var28.a()) {
                        var29 = var8.i(var28.v());
                        var31 = (float)(zbuk.a(var3, var29) / (var8.z() - var8.D()) * (double)var1.S().i());
                        if (var8.p()) {
                           var31 = -var31;
                        }

                        a(var0, var28, var1, var2, var31, var37, var15, var17, var24 + 1, var18.size());
                        var32 = true;
                        if (zbuk.a((double)var31, 0.0D) < 0.0D) {
                           var32 = true;
                        } else {
                           var32 = false;
                        }

                        var33 = a(var1, var2, var31, var37, var15, var17, var24 + 1, var18.size(), var32);
                        var34 = new Object[]{var24, var27, var33, var32};
                        com.aspose.cells.b.a.a.ze.a(var13, (Object)var34);
                     }
                  }
               }
            }
         } else {
            for(var19 = 0; var19 < var18.size(); ++var19) {
               var20 = var18.size() - 1 - var19;
               if (var1.E() >= 180 && var1.E() < 270) {
                  var20 = var18.size() - 1 - var20;
               }

               if (var1.K().p()) {
                  var20 = var18.size() - 1 - var20;
               }

               zbcq var21 = (zbcq)var18.get(var20);
               var22 = var21.aj();
               zjg var23 = var21.E();

               for(var24 = 0; var24 < var5; ++var24) {
                  int var25 = var24;
                  if (var1.E() >= 180 && var1.E() < 270) {
                     var25 = var5 - 1 - var24;
                  }

                  float var26 = var14 * (float)var25 + var16 / 2.0F;
                  var26 += var1.S().e();
                  var27 = var25;
                  if (var9.p()) {
                     var27 = var5 - 1 - var25;
                  }

                  var28 = var23.b(var27);
                  if (var28 != null && !var28.a()) {
                     var29 = var8.i(var28.v());
                     var31 = (float)(zbuk.a(var3, var29) / (var8.z() - var8.D()) * (double)var1.S().i());
                     if (var8.p()) {
                        var31 = -var31;
                     }

                     a(var0, var28, var1, var2, var31, var26, var15, var17, var22 + 1, var18.size());
                     var32 = true;
                     if (zbuk.a((double)var31, 0.0D) < 0.0D) {
                        var32 = true;
                     } else {
                        var32 = false;
                     }

                     var33 = a(var1, var2, var31, var26, var15, var17, var22 + 1, var18.size(), var32);
                     var34 = new Object[]{var22, var27, var33, var32};
                     com.aspose.cells.b.a.a.ze.a(var13, (Object)var34);
                  }
               }
            }
         }

         return var13;
      }
   }

   private static ArrayList c(zn var0, zig var1, float var2, double var3) throws Exception {
      zbcs var5 = var1.z();
      int var6 = var5.getCount();
      zbp var7 = var1.G();
      zbp var8 = var1.e();
      zbp var9 = var1.K();
      float var10 = (float)var1.m() / 100.0F;
      float var11 = (float)var1.n() / 100.0F;
      float var12 = (float)var1.o() / 100.0F;
      ArrayList var13 = new ArrayList();
      int var14 = (int)var8.z();
      int var15 = (int)var8.D();
      int var16 = var8.j();
      int var17 = zbr.a(var16, var14, var15, var1.X()) + 1;
      float var18 = var1.S().g() / (float)var17;
      float var19 = var18 / (1.0F + var12);
      float var20 = var19 * var12;
      float var21 = var18 * var10 / (1.0F + var11);
      ArrayList var22 = var5.j();
      ArrayList var23 = zia.a(var1.z().c(), var1.X());
      int var24 = var23.size();
      int var25;
      int var26;
      int var28;
      int var31;
      int var32;
      int var36;
      zje var37;
      double var38;
      float var40;
      boolean var41;
      com.aspose.cells.b.a.b.zo var42;
      Object[] var43;
      if (var1.E() >= 0 && var1.E() < 90 || var1.E() >= 180 && var1.E() < 270) {
         for(var25 = 0; var25 < var22.size(); ++var25) {
            var26 = var22.size() - 1 - var25;
            if (var1.E() >= 180 && var1.E() < 270) {
               var26 = var22.size() - 1 - var26;
            }

            if (var9.p()) {
               var26 = var22.size() - 1 - var26;
            }

            zbcq var44 = (zbcq)var22.get(var26);
            var28 = var44.aj();
            zjg var45 = var44.E();

            for(int var46 = 0; var46 < var24; ++var46) {
               var31 = var46;
               if (var1.E() >= 180 && var1.E() < 270) {
                  var31 = var24 - 1 - var46;
               }

               var32 = com.aspose.cells.b.a.zo.a(com.aspose.cells.b.a.zr.a(var23.get(var31)));
               var32 = zbr.a(var16, var32, var1.X());
               int var47 = zbr.a(var16, var32, (int)var8.D(), var1.X());
               float var48 = var18 * (float)var47;
               float var49 = var1.S().e() + var48 + var20 / 2.0F;
               var36 = var31;
               if (var8.p()) {
                  var36 = var24 - 1 - var31;
               }

               var37 = var45.b(var36);
               if (var37 != null && !var37.a()) {
                  var38 = var7.i(var37.v());
                  var40 = (float)(zbuk.a(var3, var38) / (var7.z() - var7.D()) * (double)var1.S().i());
                  if (var7.p()) {
                     var40 = -var40;
                  }

                  a(var0, var37, var1, var2, var40, var49, var19, var21, var28 + 1, var22.size());
                  var41 = true;
                  if (zbuk.a((double)var40, 0.0D) < 0.0D) {
                     var41 = true;
                  } else {
                     var41 = false;
                  }

                  var42 = a(var1, var2, var40, var49, var19, var21, var28 + 1, var22.size(), var41);
                  var43 = new Object[]{var28, var36, var42, var41};
                  com.aspose.cells.b.a.a.ze.a(var13, (Object)var43);
               }
            }
         }
      } else if (var1.E() >= 90 && var1.E() < 180 || var1.E() >= 270 && var1.E() < 360) {
         for(var25 = 0; var25 < var24; ++var25) {
            var26 = var25;
            if (var1.E() >= 270 && var1.E() < 360) {
               var26 = var24 - 1 - var25;
            }

            int var27 = com.aspose.cells.b.a.zo.a(com.aspose.cells.b.a.zr.a(var23.get(var26)));
            var27 = zbr.a(var16, var27, var1.X());
            var28 = zbr.a(var16, var27, (int)var8.D(), var1.X());
            float var29 = var18 * (float)var28;
            float var30 = var1.S().e() + var29 + var20 / 2.0F;

            for(var31 = 0; var31 < var22.size(); ++var31) {
               var32 = var31;
               if (var1.E() >= 270 && var1.E() < 360) {
                  var32 = var22.size() - 1 - var31;
               }

               if (var9.p()) {
                  var32 = var22.size() - 1 - var32;
               }

               zbcq var33 = (zbcq)var22.get(var32);
               int var34 = var33.aj();
               zjg var35 = var33.E();
               var36 = var26;
               if (var8.p()) {
                  var36 = var24 - 1 - var26;
               }

               var37 = var35.b(var36);
               if (var37 != null && !var37.a()) {
                  var38 = var7.i(var37.v());
                  var40 = (float)(zbuk.a(var3, var38) / (var7.z() - var7.D()) * (double)var1.S().i());
                  if (var7.p()) {
                     var40 = -var40;
                  }

                  a(var0, var37, var1, var2, var40, var30, var19, var21, var34 + 1, var22.size());
                  var41 = true;
                  if (zbuk.a((double)var40, 0.0D) < 0.0D) {
                     var41 = true;
                  } else {
                     var41 = false;
                  }

                  var42 = a(var1, var2, var40, var30, var19, var21, var34 + 1, var22.size(), var41);
                  var43 = new Object[]{var34, var36, var42, var41};
                  com.aspose.cells.b.a.a.ze.a(var13, (Object)var43);
               }
            }
         }
      }

      return var13;
   }

   static ArrayList c(zn var0, zig var1, float var2, double var3, int var5) throws Exception {
      zbcs var6 = var1.z();
      int var7 = var6.getCount();
      zbp var8 = var1.G();
      zbp var9 = var1.e();
      if (var9.k() == 2) {
         return d(var0, var1, var2, var3);
      } else {
         float var10 = (float)var1.m() / 100.0F;
         float var11 = (float)var1.n() / 100.0F;
         ArrayList var12 = new ArrayList();
         double var13 = var8.n() ? var8.g(var8.z()) : var8.z();
         double var15 = var8.n() ? var8.g(var8.D()) : var8.D();
         var3 = var8.n() ? var8.g(var3) : var3;
         boolean var17 = false;
         boolean var18 = var9.f() || var1.u();
         int var39;
         if (var18) {
            var39 = var5;
         } else {
            var39 = var5 - 1;
            if (var39 == 0) {
               var39 = 1;
            }
         }

         float var19 = var1.S().g() / (float)var39;
         float var20 = var19 * var10 / (1.0F + var11);
         ArrayList var21 = new ArrayList();
         ArrayList var22 = var6.j();
         int var23;
         int var24;
         zbcq var25;
         int var26;
         zjg var27;
         int var28;
         int var29;
         float var30;
         int var31;
         zje var32;
         double var33;
         float var35;
         Object[] var36;
         byte var37;
         Object[] var38;
         if (var1.E() >= 0 && var1.E() < 90 || var1.E() >= 180 && var1.E() < 270) {
            for(var23 = 0; var23 < var22.size(); ++var23) {
               var24 = var22.size() - 1 - var23;
               if (var1.E() >= 180 && var1.E() < 270) {
                  var24 = var22.size() - 1 - var24;
               }

               if (var1.K().p()) {
                  var24 = var22.size() - 1 - var24;
               }

               var25 = (zbcq)var22.get(var24);
               var26 = var25.aj();
               var27 = var25.E();

               for(var28 = 0; var28 < var5; ++var28) {
                  var29 = var28;
                  if (var1.E() >= 180 && var1.E() < 270) {
                     var29 = var5 - 1 - var28;
                  }

                  var30 = var19 * (float)var29;
                  var30 += var1.S().e();
                  if (var18) {
                     var30 += var19 / 2.0F;
                  }

                  var31 = var29;
                  if (var9.p()) {
                     var31 = var5 - 1 - var29;
                  }

                  var32 = var27.b(var31);
                  if (var32 != null && !var32.a()) {
                     var33 = var8.i(var32.v());
                     var35 = (float)((var3 - var33) / (var13 - var15) * (double)var1.S().i());
                     if (var8.p()) {
                        var35 = -var35;
                     }

                     var36 = new Object[]{var32, a(var0, var1, var2, var35, var30, var20, var26 + 1, var22.size())};
                     com.aspose.cells.b.a.a.ze.a(var21, (Object)var36);
                     var37 = 0;
                     if (var1.E() >= 90 && var1.E() < 270) {
                        var37 = 1;
                     }

                     var38 = new Object[]{var26, var31, ((com.aspose.cells.b.a.b.zo[])((com.aspose.cells.b.a.b.zo[])var36[1]))[var37]};
                     com.aspose.cells.b.a.a.ze.a(var12, (Object)var38);
                  } else {
                     com.aspose.cells.b.a.a.ze.a(var21, (Object)null);
                  }
               }

               a((zn)var0, (zig)var1, (List)var21);
               var21.clear();
            }
         } else if (var1.E() >= 90 && var1.E() < 180 || var1.E() >= 270 && var1.E() < 360) {
            for(var23 = 0; var23 < var22.size(); ++var23) {
               var24 = var23;
               if (var1.E() >= 270 && var1.E() < 360) {
                  var24 = var22.size() - 1 - var23;
               }

               if (var1.K().p()) {
                  var24 = var22.size() - 1 - var24;
               }

               var25 = (zbcq)var22.get(var24);
               var26 = var25.aj();
               var27 = var25.E();

               for(var28 = 0; var28 < var5; ++var28) {
                  var29 = var28;
                  if (var1.E() >= 270 && var1.E() < 360) {
                     var29 = var5 - 1 - var28;
                  }

                  var30 = var19 * (float)var29;
                  var30 += var1.S().e();
                  if (var18) {
                     var30 += var19 / 2.0F;
                  }

                  var31 = var29;
                  if (var9.p()) {
                     var31 = var5 - 1 - var29;
                  }

                  var32 = var27.b(var31);
                  if (var32 != null && !var32.a()) {
                     var33 = var8.i(var32.v());
                     var35 = (float)((var3 - var33) / (var8.z() - var8.D()) * (double)var1.S().i());
                     if (var8.p()) {
                        var35 = -var35;
                     }

                     var36 = new Object[]{var32, a(var0, var1, var2, var35, var30, var20, var26 + 1, var22.size())};
                     com.aspose.cells.b.a.a.ze.a(var21, (Object)var36);
                     var37 = 0;
                     if (var1.E() >= 90 && var1.E() < 270) {
                        var37 = 1;
                     }

                     var38 = new Object[]{var26, var31, ((com.aspose.cells.b.a.b.zo[])((com.aspose.cells.b.a.b.zo[])var36[1]))[var37]};
                     com.aspose.cells.b.a.a.ze.a(var12, (Object)var38);
                  }
               }

               a((zn)var0, (zig)var1, (List)var21);
               var21.clear();
            }
         }

         return var12;
      }
   }

   private static ArrayList d(zn var0, zig var1, float var2, double var3) throws Exception {
      zbcs var5 = var1.z();
      int var6 = var5.getCount();
      zbp var7 = var1.G();
      zbp var8 = var1.e();
      zbp var9 = var1.K();
      float var10 = (float)var1.m() / 100.0F;
      float var11 = (float)var1.n() / 100.0F;
      ArrayList var12 = new ArrayList();
      int var13 = var8.j();
      int var14 = (int)var8.D();
      int var15 = (int)var8.z();
      boolean var16 = false;
      boolean var17 = var8.f() || var1.u();
      int var43;
      if (var17) {
         var43 = zbr.a(var13, var15, var14, var1.X()) + 1;
      } else {
         var43 = zbr.a(var13, var15, var14, var1.X());
         if (var43 == 0) {
            var43 = 1;
         }
      }

      float var18 = var1.S().g() / (float)var43;
      float var19 = var18 * var10 / (1.0F + var11);
      ArrayList var20 = new ArrayList();
      ArrayList var21 = var5.j();
      ArrayList var22 = zia.a(var1.z().c(), var1.X());
      int var23 = var22.size();
      int var24;
      int var25;
      zbcq var26;
      int var27;
      zjg var28;
      int var29;
      int var30;
      int var31;
      int var32;
      float var33;
      float var34;
      int var35;
      zje var36;
      double var37;
      float var39;
      Object[] var40;
      byte var41;
      Object[] var42;
      if (var1.E() >= 0 && var1.E() < 90 || var1.E() >= 180 && var1.E() < 270) {
         for(var24 = 0; var24 < var21.size(); ++var24) {
            var25 = var21.size() - 1 - var24;
            if (var1.E() >= 180 && var1.E() < 270) {
               var25 = var21.size() - 1 - var25;
            }

            if (var9.p()) {
               var25 = var21.size() - 1 - var25;
            }

            var26 = (zbcq)var21.get(var25);
            var27 = var26.aj();
            var28 = var26.E();

            for(var29 = 0; var29 < var23; ++var29) {
               var30 = var29;
               if (var1.E() >= 180 && var1.E() < 270) {
                  var30 = var23 - 1 - var29;
               }

               var31 = com.aspose.cells.b.a.zo.a(com.aspose.cells.b.a.zr.a(var22.get(var30)));
               var31 = zbr.a(var13, var31, var1.X());
               var32 = zbr.a(var13, var31, (int)var8.D(), var1.X());
               var33 = var18 * (float)var32;
               var34 = var1.S().e() + var33;
               if (var17) {
                  var34 += var18 / 2.0F;
               }

               var35 = var30;
               if (var8.p()) {
                  var35 = var23 - 1 - var30;
               }

               var36 = var28.b(var35);
               if (var36 != null && !var36.a()) {
                  var37 = var7.i(var36.v());
                  var39 = (float)((var3 - var37) / (var7.z() - var7.D()) * (double)var1.S().i());
                  if (var7.p()) {
                     var39 = -var39;
                  }

                  var40 = new Object[]{var36, a(var0, var1, var2, var39, var34, var19, var27 + 1, var21.size())};
                  com.aspose.cells.b.a.a.ze.a(var20, (Object)var40);
                  var41 = 0;
                  if (var1.E() >= 90 && var1.E() < 270) {
                     var41 = 1;
                  }

                  var42 = new Object[]{var27, var35, ((com.aspose.cells.b.a.b.zo[])((com.aspose.cells.b.a.b.zo[])var40[1]))[var41]};
                  com.aspose.cells.b.a.a.ze.a(var12, (Object)var42);
               } else {
                  com.aspose.cells.b.a.a.ze.a(var20, (Object)null);
               }
            }

            a((zn)var0, (zig)var1, (List)var20);
            var20.clear();
         }
      } else if (var1.E() >= 90 && var1.E() < 180 || var1.E() >= 270 && var1.E() < 360) {
         for(var24 = 0; var24 < var21.size(); ++var24) {
            var25 = var24;
            if (var1.E() >= 270 && var1.E() < 360) {
               var25 = var21.size() - 1 - var24;
            }

            if (var9.p()) {
               var25 = var21.size() - 1 - var25;
            }

            var26 = (zbcq)var21.get(var25);
            var27 = var26.aj();
            var28 = var26.E();

            for(var29 = 0; var29 < var23; ++var29) {
               var30 = var29;
               if (var1.E() >= 270 && var1.E() < 360) {
                  var30 = var23 - 1 - var29;
               }

               var31 = com.aspose.cells.b.a.zo.a(com.aspose.cells.b.a.zr.a(var22.get(var30)));
               var31 = zbr.a(var13, var31, var1.X());
               var32 = zbr.a(var13, var31, (int)var8.D(), var1.X());
               var33 = var18 * (float)var32;
               var34 = var1.S().e() + var33;
               if (var17) {
                  var34 += var18 / 2.0F;
               }

               var35 = var30;
               if (var8.p()) {
                  var35 = var23 - 1 - var30;
               }

               var36 = var28.b(var35);
               if (var36 != null && !var36.a()) {
                  var37 = var7.i(var36.v());
                  var39 = (float)((var3 - var37) / (var7.z() - var7.D()) * (double)var1.S().i());
                  if (var7.p()) {
                     var39 = -var39;
                  }

                  var40 = new Object[]{var36, a(var0, var1, var2, var39, var34, var19, var27 + 1, var21.size())};
                  com.aspose.cells.b.a.a.ze.a(var20, (Object)var40);
                  var41 = 0;
                  if (var1.E() >= 90 && var1.E() < 270) {
                     var41 = 1;
                  }

                  var42 = new Object[]{var27, var35, ((com.aspose.cells.b.a.b.zo[])((com.aspose.cells.b.a.b.zo[])var40[1]))[var41]};
                  com.aspose.cells.b.a.a.ze.a(var12, (Object)var42);
               }
            }

            a((zn)var0, (zig)var1, (List)var20);
            var20.clear();
         }
      }

      return var12;
   }

   private static void a(double var0, Object[] var2, ArrayList var3, zbp var4) {
      zig var5 = var4.e();
      int var6 = (int)((double)((Float)var2[2] + (Float)var2[3]) + 0.5D);
      if (var3.size() == 0) {
         com.aspose.cells.b.a.a.ze.a(var3, (Object)var2);
      } else {
         for(int var7 = 0; var7 < var3.size(); ++var7) {
            Object[] var8 = (Object[])((Object[])var3.get(var7));
            int var9 = (int)((double)((Float)var8[2] + (Float)var8[3]) + 0.5D);
            if (var5.p() >= 0) {
               if (var6 > var9) {
                  var3.add(var7, var2);
                  break;
               }

               if (var6 == var9) {
                  if (var4.p()) {
                     if (var0 > 0.0D) {
                        var3.add(var7, var2);
                     } else {
                        var3.add(var7 + 1, var2);
                     }
                  } else if (var0 < 0.0D) {
                     var3.add(var7, var2);
                  } else {
                     var3.add(var7 + 1, var2);
                  }
                  break;
               }

               if (var7 == var3.size() - 1) {
                  com.aspose.cells.b.a.a.ze.a(var3, (Object)var2);
                  break;
               }
            } else {
               if (var6 < var9) {
                  var3.add(var7, var2);
                  break;
               }

               if (var6 == var9) {
                  if (!var4.p()) {
                     if (var0 > 0.0D) {
                        var3.add(var7, var2);
                     } else {
                        var3.add(var7 + 1, var2);
                     }
                  } else if (var0 < 0.0D) {
                     var3.add(var7, var2);
                  } else {
                     var3.add(var7 + 1, var2);
                  }
                  break;
               }

               if (var7 == var3.size() - 1) {
                  com.aspose.cells.b.a.a.ze.a(var3, (Object)var2);
                  break;
               }
            }
         }
      }

   }

   private static com.aspose.cells.b.a.b.zo a(zig var0, float var1, float var2, float var3, float var4, float var5, boolean var6) {
      float var7 = var2 / 2.0F;
      float var9 = var0.S().j();
      var1 += var7;
      com.aspose.cells.b.a.b.zo var10 = com.aspose.cells.b.a.b.zo.a();
      float var8;
      if (var1 <= var9) {
         var8 = 2.0F * (var9 - var1);
         var10 = a(var0, var4 + var5, var8, var3, 0);
      } else {
         var8 = 2.0F * (var1 - var9);
         var10 = a(var0, var4 + var5, var8, var3, 1);
      }

      float var11 = (float)(2 * zpw.a + 1);
      if (var6) {
         var10.b(var10.e() - var11);
      } else {
         var10.b(var10.e() + var11);
      }

      return var10;
   }

   static com.aspose.cells.b.a.b.zo a(zig var0, float var1, float var2, float var3, float var4, float var5) {
      int var6 = var0.E() / 45;
      float var7 = 0.0F;
      byte var8 = 0;
      switch(var6) {
      case 0:
      case 8:
         var7 = var2 / 2.0F;
         break;
      case 1:
         var7 = var2;
         var3 = 0.0F;
         break;
      case 2:
         var7 = var2;
         var3 = 0.0F;
         break;
      case 3:
         var7 = var2 / 2.0F;
         var8 = 1;
         break;
      case 4:
         var7 = var2 / 2.0F;
         var8 = 2;
         break;
      case 5:
         var7 = 0.0F;
         var3 = 0.0F;
         break;
      case 6:
         var7 = 0.0F;
         var3 = 0.0F;
         break;
      case 7:
         var7 = var2 / 2.0F;
      }

      float var10 = var0.S().j();
      var1 += var7;
      float var9;
      byte var11;
      if (var1 <= var10) {
         var9 = 2.0F * (var10 - var1);
         if (var8 == 0) {
            var11 = 0;
         } else {
            var11 = 3;
         }

         return a(var0, var4 + var5 / 2.0F, var9, var3, var11);
      } else {
         var9 = 2.0F * (var1 - var10);
         if (var8 == 0) {
            var11 = 1;
         } else {
            var11 = 2;
         }

         return a(var0, var4 + var5 / 2.0F, var9, var3, var11);
      }
   }

   static void c(zn var0, zig var1, ArrayList var2) throws Exception {
      zbcs var3 = var1.z();

      for(int var4 = 0; var4 < var2.size(); ++var4) {
         Object[] var5 = (Object[])((Object[])var2.get(var4));
         int var6 = (Integer)var5[0];
         int var7 = (Integer)var5[1];
         com.aspose.cells.b.a.b.zo var8 = (com.aspose.cells.b.a.b.zo)var5[2];
         boolean var9 = false;
         boolean var10 = false;
         if (var5.length == 4) {
            var9 = true;
            var10 = (Boolean)var5[3];
         }

         zpu var11 = var3.c(var6).E().b(var7).o();
         com.aspose.cells.b.a.b.zt var12 = zpw.a(var0, var1.e(), var3, var6, var7, (int)var1.S().g());
         float var13 = var8.d() - var12.b() / 2.0F;
         float var14 = var8.e() - var12.c() / 2.0F;
         if (var9) {
            if (var10) {
               var14 = var8.e() - var12.c();
            } else {
               var14 = var8.e();
            }
         }

         var11.a().b = new com.aspose.cells.b.a.b.zp(zbuk.c((double)var13), zbuk.c((double)var14), zbuk.a((double)var12.b()), zbuk.a((double)var12.c()));
         var11.a().z();
         zpw.a(var0, var1.e(), var3, var6, var7, var11.a().a);
      }

   }

   private static void a(zn var0, zje var1, zig var2, float var3, float var4, float var5, float var6, float var7, double var8, double[] var10) {
      zbcq var11 = var1.g().a();
      double var12 = 1.0D;
      double var14 = 1.0D;
      double var16;
      double var18;
      double[] var20;
      double[] var21;
      switch(var11.H()) {
      case 0:
         a(var0, var1, var2, var3, var4, var5, var6, var7, (float)var12, (float)var14);
         break;
      case 1:
         if (var11.an()) {
            zbcs var30 = var2.z();
            ArrayList var17 = var30.j();
            zbcq var31 = (zbcq)var17.get(0);
            int var19 = zia.a(var17);
            double var32 = 0.0D;
            if (var19 == 1) {
               var32 = var2.F().D();
            } else if (var19 == 2) {
               var32 = var2.F().z();
            }

            double var22 = 0.0D;
            double var24 = 0.0D;
            double[] var26 = new double[]{var22};
            double[] var27 = new double[]{var24};
            a(var11.ai(), var1.G(), var26, var27);
            var22 = var26[0];
            var24 = var27[0];
            if (var1.v() == 0.0D) {
               var12 = var10[0];
               var14 = var10[0];
            } else {
               double var28;
               if (var1.v() > 0.0D) {
                  var28 = var1.v();
                  if (var11 == var31) {
                     var28 -= var32;
                  }

                  var12 = var22 == 0.0D ? 1.0D : (var22 - var8) / (var22 - var32);
                  var14 = var22 == 0.0D ? 1.0D : (var22 - (var8 - var28)) / (var22 - var32);
               } else {
                  var28 = var1.v();
                  if (var11 == var31) {
                     var28 -= var32;
                  }

                  var12 = var24 == 0.0D ? 1.0D : (var24 - var8) / (var24 - var32);
                  var14 = var24 == 0.0D ? 1.0D : (var24 - (var8 - var28)) / (var24 - var32);
               }
            }
         } else if (var11.ap()) {
            var16 = 0.0D;
            var18 = 0.0D;
            var20 = new double[]{var16};
            var21 = new double[]{var18};
            a(var11.ai(), var1.G(), var20, var21);
            var16 = var20[0];
            var18 = var21[0];
            if (var1.v() == 0.0D) {
               var12 = var10[0];
               var14 = var10[0];
            } else if (var1.v() > 0.0D) {
               var12 = var16 == 0.0D ? 1.0D : (var16 - var8) / var16;
               var14 = var16 == 0.0D ? 1.0D : (var16 - (var8 - var1.v())) / var16;
            } else {
               var12 = var18 == 0.0D ? 1.0D : (var18 - var8) / var18;
               var14 = var18 == 0.0D ? 1.0D : (var18 - (var8 - var1.v())) / var18;
            }
         } else {
            var12 = 0.0D;
         }

         a(var0, var1, var2, var3, var4, var5, var6, var7, (float)var12, (float)var14);
         break;
      case 2:
         if (var11.an()) {
            var16 = 0.0D;
            var18 = 0.0D;
            var20 = new double[]{var16};
            var21 = new double[]{var18};
            b(var11.ai(), var1.G(), var20, var21);
            var16 = var20[0];
            var18 = var21[0];
            if (var1.v() == 0.0D) {
               var12 = var10[0];
               var14 = var10[0];
            } else if (var1.v() > 0.0D) {
               var12 = var16 == 0.0D ? 1.0D : (var16 - var8) / var16;
               var14 = var16 == 0.0D ? 1.0D : (var16 - (var8 - var1.v())) / var16;
            } else {
               var12 = var18 == 0.0D ? 1.0D : (var18 - var8) / var18;
               var14 = var18 == 0.0D ? 1.0D : (var18 - (var8 - var1.v())) / var18;
            }
         } else if (var11.ap()) {
            var16 = 0.0D;
            var18 = 0.0D;
            var20 = new double[]{var16};
            var21 = new double[]{var18};
            a(var11.ai(), var1.G(), var20, var21);
            var16 = var20[0];
            var18 = var21[0];
            if (var1.v() == 0.0D) {
               var12 = var10[0];
               var14 = var10[0];
            } else if (var1.v() > 0.0D) {
               var12 = var16 == 0.0D ? 1.0D : (var16 - var8) / var16;
               var14 = var16 == 0.0D ? 1.0D : (var16 - (var8 - var1.v())) / var16;
            } else {
               var12 = var18 == 0.0D ? 1.0D : (var18 - var8) / var18;
               var14 = var18 == 0.0D ? 1.0D : (var18 - (var8 - var1.v())) / var18;
            }
         } else {
            var12 = (double)((float)b(var1));
            var14 = 1.0D;
         }

         a(var0, var1, var2, var3, var4, var5, var6, var7, (float)var12, (float)var14);
         break;
      case 3:
         b(var0, var1, var2, var3, var4, var5, var6, var7, (float)var12, (float)var14);
         break;
      case 4:
         if (!var11.an() && !var11.ap()) {
            var12 = 0.0D;
         } else {
            var16 = 0.0D;
            var18 = 0.0D;
            var20 = new double[]{var16};
            var21 = new double[]{var18};
            a(var11.ai(), var1.G(), var20, var21);
            var16 = var20[0];
            var18 = var21[0];
            if (var1.v() == 0.0D) {
               var12 = var10[0];
               var14 = var10[0];
            } else if (var1.v() > 0.0D) {
               var12 = var16 == 0.0D ? 1.0D : (var16 - var8) / var16;
               var14 = var16 == 0.0D ? 1.0D : (var16 - (var8 - var1.v())) / var16;
            } else {
               var12 = var18 == 0.0D ? 1.0D : (var18 - var8) / var18;
               var14 = var18 == 0.0D ? 1.0D : (var18 - (var8 - var1.v())) / var18;
            }
         }

         b(var0, var1, var2, var3, var4, var5, var6, var7, (float)var12, (float)var14);
         break;
      case 5:
         if (var11.an()) {
            var16 = 0.0D;
            var18 = 0.0D;
            var20 = new double[]{var16};
            var21 = new double[]{var18};
            b(var11.ai(), var1.G(), var20, var21);
            var16 = var20[0];
            var18 = var21[0];
            if (var1.v() == 0.0D) {
               var12 = var10[0];
               var14 = var10[0];
            } else if (var1.v() > 0.0D) {
               var12 = var16 == 0.0D ? 1.0D : (var16 - var8) / var16;
               var14 = var16 == 0.0D ? 1.0D : (var16 - (var8 - var1.v())) / var16;
            } else {
               var12 = var18 == 0.0D ? 1.0D : (var18 - var8) / var18;
               var14 = var18 == 0.0D ? 1.0D : (var18 - (var8 - var1.v())) / var18;
            }
         } else if (var11.ap()) {
            var16 = 0.0D;
            var18 = 0.0D;
            var20 = new double[]{var16};
            var21 = new double[]{var18};
            a(var11.ai(), var1.G(), var20, var21);
            var16 = var20[0];
            var18 = var21[0];
            if (var1.v() == 0.0D) {
               var12 = var10[0];
               var14 = var10[0];
            } else if (var1.v() > 0.0D) {
               var12 = var16 == 0.0D ? 1.0D : (var16 - var8) / var16;
               var14 = var16 == 0.0D ? 1.0D : (var16 - (var8 - var1.v())) / var16;
            } else {
               var12 = var18 == 0.0D ? 1.0D : (var18 - var8) / var18;
               var14 = var18 == 0.0D ? 1.0D : (var18 - (var8 - var1.v())) / var18;
            }
         } else {
            var12 = (double)((float)b(var1));
            var14 = 1.0D;
         }

         b(var0, var1, var2, var3, var4, var5, var6, var7, (float)var12, (float)var14);
      }

   }

   static com.aspose.cells.b.a.b.zo a(zig var0, float var1, float var2, float var3, int var4) {
      com.aspose.cells.b.a.b.zo var5 = new com.aspose.cells.b.a.b.zo(var0.S().e() + var0.S().g() / 2.0F, var1);
      int var6 = var0.E() % 90;
      if (var6 >= 45) {
         var6 = 90 - var6;
      }

      int var9 = var0.E() / 45;
      float var7;
      float var8;
      switch(var9) {
      case 0:
      case 3:
      case 4:
      case 7:
      case 8:
         var7 = var2;
         var8 = var3;
         break;
      case 1:
      case 2:
      case 5:
      case 6:
      default:
         var7 = var3;
         var8 = var2;
      }

      float var10 = var8 * (float)Math.sin((double)var6 * 3.141592653589793D / 180.0D);
      float var11 = var8 * (float)Math.sin((double)var0.p() * 3.141592653589793D / 180.0D);
      com.aspose.cells.b.a.b.zo[] var12 = new com.aspose.cells.b.a.b.zo[4];
      zbuk.a(var12);
      switch(var9) {
      case 0:
      case 8:
         var12[0].a(var5.d() - (var7 + var10) / 2.0F);
         var12[1].a(var12[0].d() + var7);
         var12[2].a(var12[1].d() + var10);
         var12[3].a(var12[0].d() + var10);
         var12[0].b(var5.e() + var11 / 2.0F);
         var12[1].b(var12[0].e());
         var12[2].b(var12[1].e() - var11);
         var12[3].b(var12[2].e());
         break;
      case 1:
         var12[0].a(var5.d() - (var7 + var10) / 2.0F);
         var12[1].a(var12[0].d() + var10);
         var12[2].a(var12[1].d() + var7);
         var12[3].a(var12[0].d() + var7);
         var12[0].b(var5.e() - var11 / 2.0F);
         var12[1].b(var12[0].e() + var11);
         var12[2].b(var12[1].e());
         var12[3].b(var12[0].e());
         break;
      case 2:
         var12[1].a(var5.d() - (var7 + var10) / 2.0F);
         var12[0].a(var12[1].d() + var10);
         var12[2].a(var12[1].d() + var7);
         var12[3].a(var12[0].d() + var7);
         var12[0].b(var5.e() - var11 / 2.0F);
         var12[1].b(var12[0].e() + var11);
         var12[2].b(var12[1].e());
         var12[3].b(var12[0].e());
         break;
      case 3:
         var12[1].a(var5.d() - (var7 + var10) / 2.0F);
         var12[0].a(var12[1].d() + var7);
         var12[2].a(var12[1].d() + var10);
         var12[3].a(var12[2].d() + var7);
         var12[0].b(var5.e() - var11 / 2.0F);
         var12[1].b(var12[0].e());
         var12[2].b(var12[1].e() + var11);
         var12[3].b(var12[2].e());
         break;
      case 4:
         var12[0].a(var5.d() + (var7 + var10) / 2.0F);
         var12[1].a(var12[0].d() - var7);
         var12[2].a(var12[1].d() - var10);
         var12[3].a(var12[2].d() + var7);
         var12[0].b(var5.e() - var11 / 2.0F);
         var12[1].b(var12[0].e());
         var12[2].b(var12[1].e() + var11);
         var12[3].b(var12[2].e());
         break;
      case 5:
         var12[0].a(var5.d() + (var7 + var10) / 2.0F);
         var12[1].a(var12[0].d() - var10);
         var12[2].a(var12[1].d() - var7);
         var12[3].a(var12[0].d() - var7);
         var12[0].b(var5.e() + var11 / 2.0F);
         var12[1].b(var12[0].e() - var11);
         var12[2].b(var12[1].e());
         var12[3].b(var12[0].e());
         break;
      case 6:
         var12[1].a(var5.d() + (var7 + var10) / 2.0F);
         var12[0].a(var12[1].d() - var10);
         var12[2].a(var12[1].d() - var7);
         var12[3].a(var12[0].d() - var7);
         var12[0].b(var5.e() + var11 / 2.0F);
         var12[1].b(var12[0].e() - var11);
         var12[2].b(var12[1].e());
         var12[3].b(var12[0].e());
         break;
      case 7:
         var12[1].a(var5.d() + (var7 + var10) / 2.0F);
         var12[0].a(var12[1].d() - var7);
         var12[2].a(var12[1].d() - var10);
         var12[3].a(var12[2].d() - var7);
         var12[0].b(var5.e() + var11 / 2.0F);
         var12[1].b(var12[0].e());
         var12[2].b(var12[1].e() - var11);
         var12[3].b(var12[2].e());
      }

      return var12[var4];
   }

   static com.aspose.cells.b.a.b.zo[] a(zn var0, zig var1, float var2, float var3, float var4, float var5, int var6, int var7) {
      float var8 = var5 * (float)var1.n() / 100.0F;
      com.aspose.cells.b.a.b.zo[] var9 = new com.aspose.cells.b.a.b.zo[2];
      zbuk.a(var9);
      float var12 = var1.S().j();
      zbp var13 = var1.K();
      float var14 = var1.S().h() / (float)var7;
      float var15 = (float)var7 / 2.0F;
      if (var13.p()) {
         var6 = var7 + 1 - var6;
      }

      float var10;
      float var11;
      if ((float)var6 <= var15 && !var13.p()) {
         var11 = ((var15 - (float)var6) * var14 + var8 / 2.0F + var5) * 2.0F;
         if (var4 <= var12) {
            var10 = 2.0F * (var12 - var4);
            var9[0] = a(var1, var2 + var3, var10, var11, 0);
            var11 -= var5 * 2.0F;
            var9[1] = a(var1, var2 + var3, var10, var11, 0);
         } else {
            var10 = 2.0F * (var4 - var12);
            var9[0] = a(var1, var2 + var3, var10, var11, 1);
            var11 -= var5 * 2.0F;
            var9[1] = a(var1, var2 + var3, var10, var11, 1);
         }
      } else {
         var11 = (((float)var6 - var15) * var14 - var8 / 2.0F - var5) * 2.0F;
         if (var4 <= var12) {
            var10 = 2.0F * (var12 - var4);
            var9[0] = a(var1, var2 + var3, var10, var11, 3);
            var11 += var5 * 2.0F;
            var9[1] = a(var1, var2 + var3, var10, var11, 3);
         } else {
            var10 = 2.0F * (var4 - var12);
            var9[0] = a(var1, var2 + var3, var10, var11, 2);
            var11 += var5 * 2.0F;
            var9[1] = a(var1, var2 + var3, var10, var11, 2);
         }
      }

      return var9;
   }

   private static void a(zn var0, zje var1, zig var2, float var3, float var4, float var5, float var6, float var7, int var8, int var9) {
      zbcq var10 = var1.g().a();
      switch(var10.H()) {
      case 0:
         a(var0, var1, var2, var3, var4, var5, var6, var7, var8, var9, 1.0F);
         break;
      case 1:
         a(var0, var1, var2, var3, var4, var5, var6, var7, var8, var9, 0.0F);
      case 2:
      default:
         break;
      case 3:
         b(var0, var1, var2, var3, var4, var5, var6, var7, var8, var9, 1.0F);
         break;
      case 4:
         b(var0, var1, var2, var3, var4, var5, var6, var7, var8, var9, 0.0F);
      }

   }

   private static void a(zn var0, zje var1, zig var2, float var3, float var4, float var5, float var6, float var7, int var8, int var9, float var10) {
      float var11 = var7 * (float)var2.n() / 100.0F;
      com.aspose.cells.b.a.b.zo[] var12 = new com.aspose.cells.b.a.b.zo[8];
      zbuk.a(var12);
      float var15 = var2.S().j();
      zbp var16 = var2.K();
      float var17 = var5;
      float var18 = var5 + var6 * (1.0F - var10) / 2.0F;
      float var19 = var2.S().h() / (float)var9;
      float var20 = (float)var9 / 2.0F;
      if (var16.p()) {
         var8 = var9 + 1 - var8;
      }

      boolean var21 = false;
      if ((float)var8 <= var20 && !var16.p()) {
         var21 = true;
      }

      float var14 = (((float)var8 - var20) * var19 - var11 / 2.0F - var7) * 2.0F;
      byte var22;
      byte var23;
      if (var21) {
         var14 = -var14;
         var22 = 0;
         var23 = 1;
      } else {
         var22 = 3;
         var23 = 2;
      }

      byte var24 = 3;
      com.aspose.cells.b.a.b.zo var25 = com.aspose.cells.b.a.b.zo.a();

      for(int var26 = 0; var26 < 2; ++var26) {
         float var13;
         if (var17 <= var15) {
            var13 = 2.0F * (var15 - var17);
            var12[var26] = a(var2, var3, var13, var14, var22);
            if (var21) {
               var14 -= var7 * 2.0F;
            } else {
               var14 += var7 * 2.0F;
            }

            var12[var26 + var24] = a(var2, var3, var13, var14, var22);
         } else {
            var13 = 2.0F * (var17 - var15);
            var12[var26] = a(var2, var3, var13, var14, var23);
            if (var21) {
               var14 -= var7 * 2.0F;
            } else {
               var14 += var7 * 2.0F;
            }

            var12[var26 + var24] = a(var2, var3, var13, var14, var23);
         }

         var14 = (((float)var8 - var20) * var19 - var11 / 2.0F - var7) * 2.0F;
         if (var21) {
            var14 = -var14;
         }

         if (var18 <= var15) {
            var13 = 2.0F * (var15 - var18);
            var25 = a(var2, var3, var13, a(var14, var21, var7, var10), var22);
            var12[var26 + 4].a(var25.d());
            var12[var26 + 4].b(var25.e() + var4);
            if (var10 == 1.0F) {
               if (var21) {
                  var14 -= var7 * 2.0F;
               } else {
                  var14 += var7 * 2.0F;
               }
            }

            var25 = a(var2, var3, var13, a(var14, var21, var7, var10), var22);
            var12[var26 + var24 + 4].a(var25.d());
            var12[var26 + var24 + 4].b(var25.e() + var4);
         } else {
            var13 = 2.0F * (var18 - var15);
            var25 = a(var2, var3, var13, a(var14, var21, var7, var10), var23);
            var12[var26 + 4].a(var25.d());
            var12[var26 + 4].b(var25.e() + var4);
            if (var10 == 1.0F) {
               if (var21) {
                  var14 -= var7 * 2.0F;
               } else {
                  var14 += var7 * 2.0F;
               }
            }

            var25 = a(var2, var3, var13, a(var14, var21, var7, var10), var23);
            var12[var26 + var24 + 4].a(var25.d());
            var12[var26 + var24 + 4].b(var25.e() + var4);
         }

         var24 = 1;
         var17 += var6;
         var18 += var6 * var10;
         var14 = (((float)var8 - var20) * var19 - var11 / 2.0F - var7) * 2.0F;
         if (var21) {
            var14 = -var14;
         }
      }

      com.aspose.cells.b.a.a.ze.a(var1.b, (Object)(new com.aspose.cells.b.a.b.zo(var12[0].d(), var12[0].e())));
      com.aspose.cells.b.a.a.ze.a(var1.b, (Object)(new com.aspose.cells.b.a.b.zo(var12[1].d(), var12[1].e())));
      com.aspose.cells.b.a.a.ze.a(var1.b, (Object)(new com.aspose.cells.b.a.b.zo(var12[2].d(), var12[2].e())));
      com.aspose.cells.b.a.a.ze.a(var1.b, (Object)(new com.aspose.cells.b.a.b.zo(var12[3].d(), var12[3].e())));
      com.aspose.cells.b.a.a.ze.a(var1.c, (Object)(new com.aspose.cells.b.a.b.zo(var12[4].d(), var12[4].e())));
      com.aspose.cells.b.a.a.ze.a(var1.c, (Object)(new com.aspose.cells.b.a.b.zo(var12[5].d(), var12[5].e())));
      com.aspose.cells.b.a.a.ze.a(var1.c, (Object)(new com.aspose.cells.b.a.b.zo(var12[6].d(), var12[6].e())));
      com.aspose.cells.b.a.a.ze.a(var1.c, (Object)(new com.aspose.cells.b.a.b.zo(var12[7].d(), var12[7].e())));
      a(var0, var2, var1, var12, var4);
   }

   private static void b(zn var0, zje var1, zig var2, float var3, float var4, float var5, float var6, float var7, int var8, int var9, float var10) {
      float var12 = var2.S().j();
      HashMap var13 = new HashMap();
      HashMap var14 = new HashMap();
      float var15 = var5 + var6 / 2.0F;
      float var16 = var7 * (float)var2.n() / 100.0F;
      zbp var18 = var2.K();
      float var19 = var2.S().h() / (float)var9;
      float var20 = (float)var9 / 2.0F;
      if (var18.p()) {
         var8 = var9 + 1 - var8;
      }

      boolean var21 = false;
      if ((float)var8 <= var20 && !var18.p()) {
         var21 = true;
      }

      float var17 = (((float)var8 - var20) * var19 - var16 / 2.0F - var7 / 2.0F) * 2.0F;
      byte var22;
      byte var23;
      if (var21) {
         var17 = -var17;
         var22 = 0;
         var23 = 1;
      } else {
         var22 = 3;
         var23 = 2;
      }

      int var24;
      for(var24 = 0; var24 <= 180; ++var24) {
         double var25 = (double)var24 * 3.141592653589793D / 180.0D;
         float var27 = (float)((double)var7 * Math.sin(var25));
         float var28 = (float)((double)var15 + (double)(var6 / 2.0F) * Math.cos(var25));
         float var11;
         if (var28 <= var12) {
            var11 = 2.0F * (var12 - var28);
            if (!var13.containsKey(360 - var24)) {
               var13.put(360 - var24, a(var2, var3, var11, a(360 - var24, var21, var17, var27), var22));
            }

            if (!var13.containsKey(var24)) {
               var13.put(var24, a(var2, var3, var11, a(var24, var21, var17, var27), var22));
            }
         } else {
            var11 = 2.0F * (var28 - var12);
            if (!var13.containsKey(360 - var24)) {
               var13.put(360 - var24, a(var2, var3, var11, a(360 - var24, var21, var17, var27), var23));
            }

            if (!var13.containsKey(var24)) {
               var13.put(var24, a(var2, var3, var11, a(var24, var21, var17, var27), var23));
            }
         }

         var28 = (float)((double)var15 + (double)(var6 / 2.0F * var10) * Math.cos(var25));
         var27 = (float)((double)(var7 * var10) * Math.sin(var25));
         com.aspose.cells.b.a.b.zo var29;
         if (var28 <= var12) {
            var11 = 2.0F * (var12 - var28);
            if (!var14.containsKey(360 - var24)) {
               var29 = a(var2, var3, var11, a(360 - var24, var21, var17, var27), var22);
               var29.b(var29.e() + var4);
               var14.put(360 - var24, var29);
            }

            if (!var14.containsKey(var24)) {
               var29 = a(var2, var3, var11, a(var24, var21, var17, var27), var22);
               var29.b(var29.e() + var4);
               var14.put(var24, var29);
            }
         } else {
            var11 = 2.0F * (var28 - var12);
            if (!var14.containsKey(360 - var24)) {
               var29 = a(var2, var3, var11, a(360 - var24, var21, var17, var27), var23);
               var29.b(var29.e() + var4);
               var14.put(360 - var24, var29);
            }

            if (!var14.containsKey(var24)) {
               var29 = a(var2, var3, var11, a(var24, var21, var17, var27), var23);
               var29.b(var29.e() + var4);
               var14.put(var24, var29);
            }
         }
      }

      for(var24 = 0; var24 < 360; ++var24) {
         com.aspose.cells.b.a.a.ze.a(var1.c, var13.get(var24));
         com.aspose.cells.b.a.a.ze.a(var1.b, var14.get(var24));
      }

      a(var0, var1, var13, var14, var4, 175, 365);
      a(var0, var1, var13, var14, var4, 176, 364);
      a(var0, var1, var13, var14, var4, 177, 363);
      a(var0, var1, var13, var14, var4, 178, 362);
      a(var0, var1, var13, var14, var4, 179, 361);
      a(var0, var1, var13, var14, var4, 180, 360);
   }

   private static float a(int var0, boolean var1, float var2, float var3) {
      if (var1) {
         return var0 <= 180 ? var2 - var3 : var2 + var3;
      } else {
         return var0 <= 180 ? var2 + var3 : var2 - var3;
      }
   }

   private static float a(float var0, boolean var1, float var2, float var3) {
      if (var1) {
         var0 -= var2 * (1.0F - var3);
      } else {
         var0 += var2 * (1.0F - var3);
      }

      return var0;
   }

   private static void a(zn var0, zig var1, List var2) {
      zje var5;
      com.aspose.cells.b.a.b.zo[] var6;
      int var7;
      for(int var3 = 0; var3 < var2.size(); ++var3) {
         if (var2.get(var3) != null) {
            Object[] var4 = (Object[])((Object[])var2.get(var3));
            var5 = (zje)var4[0];
            if (var5 != null) {
               var6 = (com.aspose.cells.b.a.b.zo[])((com.aspose.cells.b.a.b.zo[])var4[1]);

               for(var7 = 0; var7 < var6.length; ++var7) {
                  com.aspose.cells.b.a.a.ze.a(var5.b, (Object)var6[var7]);
               }
            }
         }
      }

      if (var2.size() > 1) {
         com.aspose.cells.b.a.b.zo[] var9 = null;

         int var10;
         for(var10 = 0; var10 < var2.size(); ++var10) {
            if (var2.get(var10) != null) {
               Object[] var11 = (Object[])((Object[])var2.get(var10));
               var9 = (com.aspose.cells.b.a.b.zo[])((com.aspose.cells.b.a.b.zo[])var11[1]);
               ++var10;
               break;
            }
         }

         for(var7 = var10; var7 < var2.size(); ++var7) {
            if (var2.get(var7) != null) {
               Object[] var8 = (Object[])((Object[])var2.get(var7));
               var5 = (zje)var8[0];
               var6 = (com.aspose.cells.b.a.b.zo[])((com.aspose.cells.b.a.b.zo[])var8[1]);
               a(var0, var1, var5, var9, var6);
               var9 = var6;
            } else {
               var9 = null;
            }
         }
      }

   }

   private static void a(zn var0, zig var1, zje var2, com.aspose.cells.b.a.b.zo[] var3, com.aspose.cells.b.a.b.zo[] var4) {
      if (var3 != null && var4 != null && var2 != null) {
         zat var5 = var2.i();
         com.aspose.cells.b.a.b.a.ze var6 = new com.aspose.cells.b.a.b.a.ze();
         var6.b(new com.aspose.cells.b.a.b.zo[]{var3[0], var4[0], var4[1], var3[1]});
         com.aspose.cells.b.a.b.zc var7 = var5.b(var6);
         if (var1.E() != 0 && var1.E() != 360 && var1.E() != 180) {
            if (var1.E() != 90 && var1.E() != 270) {
               if (var3[1].d() != var4[1].d() && var3[1].e() != var4[1].e()) {
                  float var8 = 0.0F;
                  float var9 = (var8 - var3[1].e() - (var8 - var4[1].e())) / (var3[1].d() - var4[1].d());
                  float var10 = var8 - var4[1].e() - var9 * var4[1].d();
                  float var11 = var8 - var4[0].e();
                  float var12 = var9 * var4[0].d() + var10;
                  if (var1.E() > 0 && var1.E() < 90 || var1.E() > 270 && var1.E() < 360) {
                     if (var11 > var12) {
                        var7 = var5.b(var6, 0.6666667F);
                     } else {
                        var7 = var5.b(var6);
                     }
                  } else if (var1.E() > 90 && var1.E() < 270) {
                     if (var11 < var12) {
                        var7 = var5.b(var6, 0.6666667F);
                     } else {
                        var7 = var5.b(var6);
                     }
                  }
               }
            } else if (var4[0].e() > var3[0].e()) {
               var7 = var5.b(var6);
            } else {
               var7 = var5.b(var6, 0.6666667F);
            }
         } else if (var4[1].e() > var4[0].e()) {
            if (var1.E() != 0 && var1.E() != 360) {
               var7 = var5.b(var6);
            } else {
               var7 = var5.b(var6, 0.6666667F);
            }
         } else if (var1.E() != 0 && var1.E() != 360) {
            var7 = var5.b(var6, 0.6666667F);
         } else {
            var7 = var5.b(var6);
         }

         var0.a(var7, var6);
         com.aspose.cells.b.a.b.zm var13 = var2.k().b(var6);
         var0.a(var13, var3[0], var4[0]);
         var0.a(var13, var4[0], var4[1]);
         var0.a(var13, var4[1], var3[1]);
         var0.a(var13, var3[1], var3[0]);
         var7.h();
         var13.a();
      }
   }

   private static com.aspose.cells.b.a.b.zo a(zig var0, float var1, float var2, float var3, float var4, float var5, int var6, int var7, boolean var8) {
      int var9 = var0.E() / 45;
      float var10 = 0.0F;
      float var11 = 0.0F;
      switch(var9) {
      case 0:
      case 8:
         var10 = var4 / 2.0F;
         break;
      case 1:
         var10 = var4;
         var11 = var5 / 2.0F;
         break;
      case 2:
         var10 = var4;
         var11 = var5 / 2.0F;
         break;
      case 3:
         var10 = var4 / 2.0F;
         var11 = var5;
         break;
      case 4:
         var10 = var4 / 2.0F;
         var11 = var5;
         break;
      case 5:
         var10 = 0.0F;
         var11 = var5 / 2.0F;
         break;
      case 6:
         var10 = 0.0F;
         var11 = var5 / 2.0F;
         break;
      case 7:
         var10 = var4 / 2.0F;
      }

      float var12 = var0.S().j();
      var3 += var10;
      zbp var16 = var0.K();
      float var17 = var5 * (float)var0.n() / 100.0F;
      float var18 = var0.S().h() / (float)var7;
      float var19 = (float)var7 / 2.0F;
      if (var16.p()) {
         var6 = var7 + 1 - var6;
      }

      com.aspose.cells.b.a.b.zo var13;
      float var14;
      float var15;
      if ((float)var6 <= var19 && !var16.p()) {
         var15 = ((var19 - (float)var6) * var18 + var17 / 2.0F + var5 - var11) * 2.0F;
         if (var3 <= var12) {
            var14 = 2.0F * (var12 - var3);
            var13 = a(var0, var1 + var2, var14, var15, 0);
         } else {
            var14 = 2.0F * (var3 - var12);
            var13 = a(var0, var1 + var2, var14, var15, 1);
         }
      } else {
         var15 = (((float)var6 - var19) * var18 - var17 / 2.0F - var5 + var11) * 2.0F;
         if (var3 <= var12) {
            var14 = 2.0F * (var12 - var3);
            var13 = a(var0, var1 + var2, var14, var15, 3);
         } else {
            var14 = 2.0F * (var3 - var12);
            var13 = a(var0, var1 + var2, var14, var15, 2);
         }
      }

      float var20 = (float)(2 * zpw.a + 1);
      if (var8) {
         var13.b(var13.e() - var20);
      } else {
         var13.b(var13.e() + var20);
      }

      return var13;
   }

   static double b(zje var0) {
      double var1 = 0.0D;
      double var3 = 0.0D;
      zbp var5 = var0.h().G();
      double var6 = var5.X();
      zbcs var8 = var0.h().z();
      int var9 = var8.h();

      for(int var10 = 0; var10 < var0.g().getCount(); ++var10) {
         for(int var11 = 0; var11 < var8.getCount(); ++var11) {
            zje var12 = var8.c(var11).E().b(var10);
            if (var12 != null) {
               double var13 = var12.v();
               if (var13 > var6 && var1 < var13 - var6) {
                  var1 = var13 - var6;
               }

               if (var13 < var6 && var3 < var6 - var13) {
                  var3 = var6 - var13;
               }
            }
         }
      }

      double var15 = var5.i(var0.v());
      if (var0.v() >= var6) {
         return var1 == 0.0D ? 1.0D : (var1 - (var15 - var6)) / var1;
      } else {
         return var3 == 0.0D ? 1.0D : (var3 - (var6 - var15)) / var3;
      }
   }

   static void a(zbcs var0, int var1, double[] var2, double[] var3) {
      var2[0] = 0.0D;
      var3[0] = 0.0D;

      for(int var4 = 0; var4 < var0.getCount(); ++var4) {
         zbcq var5 = var0.c(var4);
         double var6 = var5.E().a(var1).v();
         if (var6 > 0.0D) {
            var2[0] += var6;
         }

         if (var6 < 0.0D) {
            var3[0] += var6;
         }
      }

   }

   static void b(zbcs var0, int var1, double[] var2, double[] var3) {
      var2[0] = 0.0D;
      var3[0] = 0.0D;
      int var4 = var0.h();

      for(int var5 = 0; var5 < var4; ++var5) {
         double var6 = 0.0D;
         double var8 = 0.0D;
         double[] var10 = new double[]{var6};
         double[] var11 = new double[]{var8};
         a(var0, var5, var10, var11);
         var6 = var10[0];
         var8 = var11[0];
         if (var6 > var2[0]) {
            var2[0] = var6;
         }

         if (var8 < var3[0]) {
            var3[0] = var8;
         }
      }

   }

   private static void a(zn var0, zje var1, zig var2, float var3, float var4, float var5, float var6, float var7, float var8, float var9) {
      com.aspose.cells.b.a.b.zo[] var11 = new com.aspose.cells.b.a.b.zo[8];
      zbuk.a(var11);
      float var13 = var2.S().j();
      zbcq var14 = var1.g().a();
      byte var15 = 3;
      com.aspose.cells.b.a.b.zo var16 = com.aspose.cells.b.a.b.zo.a();
      float var17 = var3 + var4 * (1.0F - var8) / 2.0F;
      float var18 = var3 + var4 * (1.0F - var9) / 2.0F;

      for(int var19 = 0; var19 < 2; ++var19) {
         float var12;
         if (var18 <= var13) {
            var12 = 2.0F * (var13 - var18);
            var11[var19] = a(var2, var6, var12, var5 * var9, 0);
            var11[var19 + var15] = a(var2, var6, var12, var5 * var9, 3);
         } else {
            var12 = 2.0F * (var18 - var13);
            var11[var19] = a(var2, var6, var12, var5 * var9, 1);
            var11[var19 + var15] = a(var2, var6, var12, var5 * var9, 2);
         }

         if (var17 <= var13) {
            var12 = 2.0F * (var13 - var17);
            var16 = a(var2, var6, var12, var5 * var8, 0);
            var11[var19 + 4].a(var16.d());
            var11[var19 + 4].b(var16.e() + var7);
            var16 = a(var2, var6, var12, var5 * var8, 3);
            var11[var19 + var15 + 4].a(var16.d());
            var11[var19 + var15 + 4].b(var16.e() + var7);
         } else {
            var12 = 2.0F * (var17 - var13);
            var16 = a(var2, var6, var12, var5 * var8, 1);
            var11[var19 + 4].a(var16.d());
            var11[var19 + 4].b(var16.e() + var7);
            var16 = a(var2, var6, var12, var5 * var8, 2);
            var11[var19 + var15 + 4].a(var16.d());
            var11[var19 + var15 + 4].b(var16.e() + var7);
         }

         var15 = 1;
         var18 += var4 * var9;
         var17 += var4 * var8;
      }

      com.aspose.cells.b.a.a.ze.a(var1.b, (Object)(new com.aspose.cells.b.a.b.zo(var11[0].d(), var11[0].e())));
      com.aspose.cells.b.a.a.ze.a(var1.b, (Object)(new com.aspose.cells.b.a.b.zo(var11[1].d(), var11[1].e())));
      com.aspose.cells.b.a.a.ze.a(var1.b, (Object)(new com.aspose.cells.b.a.b.zo(var11[2].d(), var11[2].e())));
      com.aspose.cells.b.a.a.ze.a(var1.b, (Object)(new com.aspose.cells.b.a.b.zo(var11[3].d(), var11[3].e())));
      com.aspose.cells.b.a.a.ze.a(var1.c, (Object)(new com.aspose.cells.b.a.b.zo(var11[4].d(), var11[4].e())));
      com.aspose.cells.b.a.a.ze.a(var1.c, (Object)(new com.aspose.cells.b.a.b.zo(var11[5].d(), var11[5].e())));
      com.aspose.cells.b.a.a.ze.a(var1.c, (Object)(new com.aspose.cells.b.a.b.zo(var11[6].d(), var11[6].e())));
      com.aspose.cells.b.a.a.ze.a(var1.c, (Object)(new com.aspose.cells.b.a.b.zo(var11[7].d(), var11[7].e())));
      a(var0, var2, var1, var11, var7);
   }

   private static void a(zn var0, zig var1, zje var2, com.aspose.cells.b.a.b.zo[] var3, float var4) {
      zat var5 = var2.i();
      com.aspose.cells.b.a.b.a.ze var6 = new com.aspose.cells.b.a.b.a.ze();
      var6.b(var3);
      com.aspose.cells.b.a.b.zm var7 = var2.k().b(var6);
      var0.a(var7, var3[0], var3[1]);
      var0.a(var7, var3[1], var3[2]);
      var0.a(var7, var3[2], var3[3]);
      var0.a(var7, var3[0], var3[3]);
      if (var4 != 0.0F) {
         var0.a(var7, var3[4], var3[5]);
         var0.a(var7, var3[5], var3[6]);
         var0.a(var7, var3[6], var3[7]);
         var0.a(var7, var3[4], var3[7]);
         var0.a(var7, var3[0], var3[4]);
         var0.a(var7, var3[1], var3[5]);
         var0.a(var7, var3[2], var3[6]);
         var0.a(var7, var3[3], var3[7]);
      }

      com.aspose.cells.b.a.b.a.ze var8;
      if (var4 != 0.0F) {
         com.aspose.cells.b.a.b.zc var9;
         com.aspose.cells.b.a.b.zm var10;
         com.aspose.cells.b.a.b.zc var11;
         com.aspose.cells.b.a.b.a.ze var91;
         if (var1.E() > 45 && var1.E() != 360) {
            if (var1.E() > 45 && var1.E() <= 90) {
               var8 = new com.aspose.cells.b.a.b.a.ze();
               var8.b(new com.aspose.cells.b.a.b.zo[]{var3[1], var3[2], var3[6], var3[5]});
               var9 = var5.b(var8);
               if (var7.c().getA() == 0) {
                  var10 = new com.aspose.cells.b.a.b.zm(var9);

                  try {
                     var0.b(var10, var3[1].d(), var3[1].e(), var3[5].d(), var3[5].e());
                  } finally {
                     if (var10 != null) {
                        var10.r();
                     }

                  }
               }

               var0.a(var9, var8);
               var9.h();
               var91 = new com.aspose.cells.b.a.b.a.ze();
               var91.b(new com.aspose.cells.b.a.b.zo[]{var3[0], var3[1], var3[5], var3[4]});
               var11 = var5.b(var91, 0.5F);
               var0.a(var11, var91);
               var11.h();
               if (var7.c().getA() != 0) {
                  var0.a(var7, var8);
                  var0.a(var7, var91);
               }
            } else if (var1.E() > 90 && var1.E() <= 135) {
               var8 = new com.aspose.cells.b.a.b.a.ze();
               var8.b(new com.aspose.cells.b.a.b.zo[]{var3[1], var3[2], var3[6], var3[5]});
               var9 = var5.b(var8);
               if (var7.c().getA() == 0) {
                  var10 = new com.aspose.cells.b.a.b.zm(var9);

                  try {
                     var0.b(var10, var3[2].d(), var3[2].e(), var3[6].d(), var3[6].e());
                  } finally {
                     if (var10 != null) {
                        var10.r();
                     }

                  }
               }

               var0.a(var9, var8);
               var9.h();
               var91 = new com.aspose.cells.b.a.b.a.ze();
               var91.b(new com.aspose.cells.b.a.b.zo[]{var3[2], var3[3], var3[7], var3[6]});
               var11 = var5.b(var91, 0.5F);
               var0.a(var11, var91);
               var11.h();
               if (var7.c().getA() != 0) {
                  var0.a(var7, var8);
                  var0.a(var7, var91);
               }
            } else if (var1.E() > 135 && var1.E() <= 180) {
               var8 = new com.aspose.cells.b.a.b.a.ze();
               var8.b(new com.aspose.cells.b.a.b.zo[]{var3[2], var3[3], var3[7], var3[6]});
               var9 = var5.b(var8);
               if (var7.c().getA() == 0) {
                  var10 = new com.aspose.cells.b.a.b.zm(var9);

                  try {
                     var0.b(var10, var3[2].d(), var3[2].e(), var3[6].d(), var3[6].e());
                  } finally {
                     if (var10 != null) {
                        var10.r();
                     }

                  }
               }

               var0.a(var9, var8);
               var9.h();
               var91 = new com.aspose.cells.b.a.b.a.ze();
               var91.b(new com.aspose.cells.b.a.b.zo[]{var3[1], var3[2], var3[6], var3[5]});
               var11 = var5.b(var91, 0.5F);
               var0.a(var11, var91);
               var11.h();
               if (var7.c().getA() != 0) {
                  var0.a(var7, var8);
                  var0.a(var7, var91);
               }
            } else if (var1.E() > 180 && var1.E() <= 225) {
               var8 = new com.aspose.cells.b.a.b.a.ze();
               var8.b(new com.aspose.cells.b.a.b.zo[]{var3[2], var3[3], var3[7], var3[6]});
               var9 = var5.b(var8);
               if (var7.c().getA() == 0) {
                  var10 = new com.aspose.cells.b.a.b.zm(var9);

                  try {
                     var0.b(var10, var3[3].d(), var3[3].e(), var3[7].d(), var3[7].e());
                  } finally {
                     if (var10 != null) {
                        var10.r();
                     }

                  }
               }

               var0.a(var9, var8);
               var9.h();
               var91 = new com.aspose.cells.b.a.b.a.ze();
               var91.b(new com.aspose.cells.b.a.b.zo[]{var3[3], var3[0], var3[4], var3[7]});
               var11 = var5.b(var91, 0.5F);
               var0.a(var11, var91);
               var11.h();
               if (var7.c().getA() != 0) {
                  var0.a(var7, var8);
                  var0.a(var7, var91);
               }
            } else if (var1.E() > 225 && var1.E() <= 270) {
               var8 = new com.aspose.cells.b.a.b.a.ze();
               var8.b(new com.aspose.cells.b.a.b.zo[]{var3[3], var3[0], var3[4], var3[7]});
               var9 = var5.b(var8);
               if (var7.c().getA() == 0) {
                  var10 = new com.aspose.cells.b.a.b.zm(var9);

                  try {
                     var0.b(var10, var3[3].d(), var3[3].e(), var3[7].d(), var3[7].e());
                  } finally {
                     if (var10 != null) {
                        var10.r();
                     }

                  }
               }

               var0.a(var9, var8);
               var9.h();
               var91 = new com.aspose.cells.b.a.b.a.ze();
               var91.b(new com.aspose.cells.b.a.b.zo[]{var3[2], var3[3], var3[7], var3[6]});
               var11 = var5.b(var91, 0.5F);
               var0.a(var11, var91);
               var11.h();
               if (var7.c().getA() != 0) {
                  var0.a(var7, var8);
                  var0.a(var7, var91);
               }
            } else if (var1.E() > 270 && var1.E() <= 315) {
               var8 = new com.aspose.cells.b.a.b.a.ze();
               var8.b(new com.aspose.cells.b.a.b.zo[]{var3[3], var3[0], var3[4], var3[7]});
               var9 = var5.b(var8);
               if (var7.c().getA() == 0) {
                  var10 = new com.aspose.cells.b.a.b.zm(var9);

                  try {
                     var0.b(var10, var3[0].d(), var3[0].e(), var3[4].d(), var3[4].e());
                  } finally {
                     if (var10 != null) {
                        var10.r();
                     }

                  }
               }

               var0.a(var9, var8);
               var9.h();
               var91 = new com.aspose.cells.b.a.b.a.ze();
               var91.b(new com.aspose.cells.b.a.b.zo[]{var3[0], var3[1], var3[5], var3[4]});
               var11 = var5.b(var91, 0.5F);
               var0.a(var11, var91);
               var11.h();
               if (var7.c().getA() != 0) {
                  var0.a(var7, var8);
                  var0.a(var7, var91);
               }
            } else if (var1.E() > 315 && var1.E() < 360) {
               var8 = new com.aspose.cells.b.a.b.a.ze();
               var8.b(new com.aspose.cells.b.a.b.zo[]{var3[0], var3[1], var3[5], var3[4]});
               var9 = var5.b(var8);
               if (var7.c().getA() == 0) {
                  var10 = new com.aspose.cells.b.a.b.zm(var9);

                  try {
                     var0.b(var10, var3[0].d(), var3[0].e(), var3[4].d(), var3[4].e());
                  } finally {
                     if (var10 != null) {
                        var10.r();
                     }

                  }
               }

               var0.a(var9, var8);
               var9.h();
               var91 = new com.aspose.cells.b.a.b.a.ze();
               var91.b(new com.aspose.cells.b.a.b.zo[]{var3[3], var3[0], var3[4], var3[7]});
               var11 = var5.b(var91, 0.5F);
               var0.a(var11, var91);
               var11.h();
               if (var7.c().getA() != 0) {
                  var0.a(var7, var8);
                  var0.a(var7, var91);
               }
            }
         } else {
            var8 = new com.aspose.cells.b.a.b.a.ze();
            var8.b(new com.aspose.cells.b.a.b.zo[]{var3[0], var3[1], var3[5], var3[4]});
            var9 = var5.b(var8);
            if (var7.c().getA() == 0) {
               var10 = new com.aspose.cells.b.a.b.zm(var9);

               try {
                  var0.b(var10, var3[1].d(), var3[1].e(), var3[5].d(), var3[5].e());
               } finally {
                  if (var10 != null) {
                     var10.r();
                  }

               }
            }

            var0.a(var9, var8);
            var9.h();
            var91 = new com.aspose.cells.b.a.b.a.ze();
            var91.b(new com.aspose.cells.b.a.b.zo[]{var3[1], var3[2], var3[6], var3[5]});
            var11 = var5.b(var91, 0.5F);
            var0.a(var11, var91);
            var11.h();
            if (var7.c().getA() != 0) {
               var0.a(var7, var8);
               var0.a(var7, var91);
            }
         }

         if (var1.p() > 0) {
            if (var4 <= 0.0F) {
               var8 = new com.aspose.cells.b.a.b.a.ze();
               var8.b(new com.aspose.cells.b.a.b.zo[]{var3[4], var3[5], var3[6], var3[7]});
               var5.a(var8, 0.6666667F);
               var2.k().a(var8);
            } else {
               var8 = new com.aspose.cells.b.a.b.a.ze();
               var8.b(new com.aspose.cells.b.a.b.zo[]{var3[0], var3[1], var3[2], var3[3]});
               var5.a(var8, 0.6666667F);
               var2.k().a(var8);
            }
         } else if (var1.p() < 0) {
            if (var4 <= 0.0F) {
               var8 = new com.aspose.cells.b.a.b.a.ze();
               var8.b(new com.aspose.cells.b.a.b.zo[]{var3[0], var3[1], var3[2], var3[3]});
               var5.a(var8, 0.33333334F);
               var2.k().a(var8);
            } else {
               var8 = new com.aspose.cells.b.a.b.a.ze();
               var8.b(new com.aspose.cells.b.a.b.zo[]{var3[4], var3[5], var3[6], var3[7]});
               var5.a(var8, 0.33333334F);
               var2.k().a(var8);
            }
         }
      } else {
         var8 = new com.aspose.cells.b.a.b.a.ze();
         var8.b(new com.aspose.cells.b.a.b.zo[]{var3[0], var3[1], var3[2], var3[3]});
         if (var1.p() > 0) {
            var5.a(var8, 0.6666667F);
         } else {
            var5.a(var8, 0.33333334F);
         }

         var2.k().a(var8);
      }

      if (var7 != null) {
         var7.a();
      }

   }

   private static void b(zn var0, zje var1, zig var2, float var3, float var4, float var5, float var6, float var7, float var8, float var9) {
      float var11 = var2.S().j();
      HashMap var12 = new HashMap();
      HashMap var13 = new HashMap();
      float var14 = var3 + var4 / 2.0F;

      int var15;
      for(var15 = 0; var15 <= 180; ++var15) {
         double var16 = (double)var15 * 3.141592653589793D / 180.0D;
         float var18 = (float)((double)var5 * Math.sin(var16));
         float var19 = (float)((double)var14 + (double)(var4 * var9 / 2.0F) * Math.cos(var16));
         float var10;
         if (var19 <= var11) {
            var10 = 2.0F * (var11 - var19);
            if (!var12.containsKey(360 - var15)) {
               var12.put(360 - var15, a(var2, var6, var10, var18 * var9, 0));
            }

            if (!var12.containsKey(var15)) {
               var12.put(var15, a(var2, var6, var10, var18 * var9, 3));
            }
         } else {
            var10 = 2.0F * (var19 - var11);
            if (!var12.containsKey(360 - var15)) {
               var12.put(360 - var15, a(var2, var6, var10, var18 * var9, 1));
            }

            if (!var12.containsKey(var15)) {
               var12.put(var15, a(var2, var6, var10, var18 * var9, 2));
            }
         }

         var19 = (float)((double)var14 + (double)(var4 * var8 / 2.0F) * Math.cos(var16));
         com.aspose.cells.b.a.b.zo var20;
         if (var19 <= var11) {
            var10 = 2.0F * (var11 - var19);
            if (!var13.containsKey(360 - var15)) {
               var20 = a(var2, var6, var10, var18 * var8, 0);
               var20.b(var20.e() + var7);
               var13.put(360 - var15, var20);
            }

            if (!var13.containsKey(var15)) {
               var20 = a(var2, var6, var10, var18 * var8, 3);
               var20.b(var20.e() + var7);
               var13.put(var15, var20);
            }
         } else {
            var10 = 2.0F * (var19 - var11);
            if (!var13.containsKey(360 - var15)) {
               var20 = a(var2, var6, var10, var18 * var8, 1);
               var20.b(var20.e() + var7);
               var13.put(360 - var15, var20);
            }

            if (!var13.containsKey(var15)) {
               var20 = a(var2, var6, var10, var18 * var8, 2);
               var20.b(var20.e() + var7);
               var13.put(var15, var20);
            }
         }
      }

      for(var15 = 0; var15 < 360; ++var15) {
         com.aspose.cells.b.a.a.ze.a(var1.c, var12.get(var15));
         com.aspose.cells.b.a.a.ze.a(var1.b, var13.get(var15));
      }

      a(var0, var1, var12, var13, var7, 175, 365);
      a(var0, var1, var12, var13, var7, 176, 364);
      a(var0, var1, var12, var13, var7, 177, 363);
      a(var0, var1, var12, var13, var7, 178, 362);
      a(var0, var1, var12, var13, var7, 179, 361);
      a(var0, var1, var12, var13, var7, 180, 360);
   }

   private static void a(zn var0, zje var1, HashMap var2, HashMap var3, float var4, int var5, int var6) {
      zbcq var7 = var1.g().a();
      zig var8 = var1.h();
      zat var9 = var1.i();
      int var10 = var8.E();
      com.aspose.cells.b.a.b.zo var11 = null;
      com.aspose.cells.b.a.b.zo var12 = null;
      byte var13 = 0;
      byte var14 = 0;
      com.aspose.cells.b.a.b.zo[] var15 = new com.aspose.cells.b.a.b.zo[]{var11};
      com.aspose.cells.b.a.b.zo[] var16 = new com.aspose.cells.b.a.b.zo[]{var12};
      int[] var17 = new int[]{var13};
      int[] var18 = new int[]{var14};
      a(var2, var15, var16, var17, var18);
      var11 = var15[0];
      var12 = var16[0];
      int var42 = var17[0];
      int var43 = var18[0];
      com.aspose.cells.b.a.b.zo var19 = null;
      com.aspose.cells.b.a.b.zo var20 = null;
      byte var21 = 0;
      byte var22 = 0;
      com.aspose.cells.b.a.b.zo[] var23 = new com.aspose.cells.b.a.b.zo[]{var19};
      com.aspose.cells.b.a.b.zo[] var24 = new com.aspose.cells.b.a.b.zo[]{var20};
      int[] var25 = new int[]{var21};
      int[] var26 = new int[]{var22};
      a(var3, var23, var24, var25, var26);
      var19 = var23[0];
      var20 = var24[0];
      int var44 = var25[0];
      int var45 = var26[0];
      if (var4 != 0.0F) {
         float var27 = 0.5F;
         float var28 = 7.56F;

         for(float var29 = (float)(var5 + var10); var29 <= (float)(var6 + var10); var29 += var28) {
            int var30 = (int)(var29 % 360.0F);
            com.aspose.cells.b.a.b.zo var31 = (com.aspose.cells.b.a.b.zo)var2.get(var30);
            com.aspose.cells.b.a.b.zo var32 = (com.aspose.cells.b.a.b.zo)var3.get(var30);
            if (var29 == (float)(var5 + var10)) {
               var31 = var12;
               var32 = var20;
            }

            float var33 = var28;
            if (var29 - (float)var5 == 45.0F && var10 <= 30 || var29 - (float)var5 == 135.0F && var10 > 30 || var29 - (float)var5 == 90.0F || var29 - (float)var5 == 180.0F || var29 - (float)var5 == 225.0F && var10 > 120 || var29 - (float)var5 == 270.0F || var29 - (float)var5 == 315.0F && var10 > 210 || var29 - (float)var5 == 360.0F || var29 - (float)var5 == 405.0F && var10 > 300 || var29 - (float)var5 == 450.0F) {
               var33 = 2.0F * var28;
            }

            if (var29 == (float)(var5 + var10)) {
               var33 = var28 - (float)var10 % var28;
            }

            int var34 = var29 + var33 > (float)(var6 + var10) ? (var6 + var10) % 360 : (int)((var29 + var33) % 360.0F);
            com.aspose.cells.b.a.b.zo var35 = (com.aspose.cells.b.a.b.zo)var2.get(var34);
            com.aspose.cells.b.a.b.zo var36 = (com.aspose.cells.b.a.b.zo)var3.get(var34);
            if (var29 + var33 >= (float)(var6 + var10)) {
               var35 = var11;
               var36 = var19;
            }

            com.aspose.cells.b.a.b.a.ze var37 = new com.aspose.cells.b.a.b.a.ze();
            com.aspose.cells.b.a.b.zo[] var38 = new com.aspose.cells.b.a.b.zo[(int)var33 + 1];
            zbuk.a(var38);
            int var39 = 0;

            for(int var40 = (int)var29; var40 <= (int)var29 + (int)var33; ++var40) {
               var38[var39] = (com.aspose.cells.b.a.b.zo)var2.get(var40 % 360);
               ++var39;
            }

            var37.a(var31, var35);
            var37.a(var35, var36);
            com.aspose.cells.b.a.b.zo[] var52 = new com.aspose.cells.b.a.b.zo[(int)var33 + 1];
            zbuk.a(var52);
            var39 = 0;

            for(int var41 = (int)var29 + (int)var33; var41 >= (int)var29; --var41) {
               var52[var39] = (com.aspose.cells.b.a.b.zo)var3.get(var41 % 360);
               ++var39;
            }

            var37.a(var36, var32);
            var37.a(var32, var31);
            if (var10 >= 0 && var10 <= 30) {
               if (var29 - (float)var5 < 45.0F) {
                  var27 = 0.75F + 0.5F * ((var29 - (float)var5) / 90.0F);
               } else {
                  var27 = 1.125F - 0.5F * ((var29 - (float)var5) / 180.0F);
               }
            } else if (var10 > 30 && var10 <= 120) {
               if (var29 - (float)var5 < 135.0F) {
                  var27 = 0.625F + 0.5F * ((var29 - (float)var5) / 180.0F);
               } else {
                  var27 = 1.375F - 0.5F * ((var29 - (float)var5) / 180.0F);
               }
            } else if (var10 > 120 && var10 <= 210) {
               if (var29 - (float)var5 < 225.0F) {
                  var27 = 0.625F + 0.5F * ((var29 - (float)var5 - 90.0F) / 180.0F);
               } else {
                  var27 = 1.375F - 0.5F * ((var29 - (float)var5 - 90.0F) / 180.0F);
               }
            } else if (var10 > 210 && var10 <= 300) {
               if (var29 - (float)var5 < 315.0F) {
                  var27 = 0.625F + 0.5F * ((var29 - (float)var5 - 180.0F) / 180.0F);
               } else {
                  var27 = 1.375F - 0.5F * ((var29 - (float)var5 - 180.0F) / 180.0F);
               }
            } else if (var10 > 300 && var10 <= 360) {
               if (var29 - (float)var5 < 405.0F) {
                  var27 = 0.625F + 0.5F * ((var29 - (float)var5 - 270.0F) / 180.0F);
               } else {
                  var27 = 1.375F - 0.5F * ((var29 - (float)var5 - 270.0F) / 180.0F);
               }
            }

            if (var27 == 1.0F) {
               var27 -= 0.011111111F;
            }

            var9.a(var37, var27);
            var29 += var33 - var28;
         }
      }

      com.aspose.cells.b.a.b.a.ze var49 = new com.aspose.cells.b.a.b.a.ze();
      com.aspose.cells.b.a.b.a.ze var46 = new com.aspose.cells.b.a.b.a.ze();
      com.aspose.cells.b.a.b.zo[] var47 = new com.aspose.cells.b.a.b.zo[var2.size()];
      com.aspose.cells.b.a.b.zo[] var48 = new com.aspose.cells.b.a.b.zo[var2.size()];
      zbuk.a(var47);
      zbuk.a(var48);

      for(int var50 = 0; var50 <= 360; ++var50) {
         var47[var50] = (com.aspose.cells.b.a.b.zo)var2.get(var50);
         var48[var50] = (com.aspose.cells.b.a.b.zo)var3.get(var50);
      }

      var49.c(var47);
      var46.c(var48);
      com.aspose.cells.b.a.b.a.ze var51;
      if (var8.p() > 0) {
         if (var4 < 0.0F) {
            var9.a(var46, 0.7F);
            var1.k().a(var46);
            a(var0, var1, var42, var43, var2);
         } else if (var4 > 0.0F) {
            var9.a(var49, 0.7F);
            var1.k().a(var49);
            a(var0, var1, var42, var43, var3);
         } else {
            var9.a(var49, 0.7F);
            var1.k().a(var49);
         }
      } else if (var8.p() < 0) {
         if (var4 < 0.0F) {
            var9.a(var49, 0.33333334F);
            var1.k().a(var49);
            a(var0, var1, var42, var43, var3);
         } else if (var4 > 0.0F) {
            var9.a(var46, 0.33333334F);
            var1.k().a(var46);
            a(var0, var1, var42, var43, var2);
         } else {
            var9.a(var49, 0.33333334F);
            var1.k().a(var49);
         }
      } else {
         var51 = new com.aspose.cells.b.a.b.a.ze();
         var51.b(var12.d(), var12.e(), var11.d(), var11.e());
         var51.b(var20.d(), var20.e(), var19.d(), var19.e());
         var1.k().a(var51);
      }

      if (var4 != 0.0F) {
         var51 = new com.aspose.cells.b.a.b.a.ze();
         var51.j();
         var51.b(var12.d(), var12.e(), var20.d(), var20.e());
         var51.j();
         var51.b(var11.d(), var11.e(), var19.d(), var19.e());
         var1.k().a(var51);
      }

   }

   private static void a(HashMap var0, com.aspose.cells.b.a.b.zo[] var1, com.aspose.cells.b.a.b.zo[] var2, int[] var3, int[] var4) {
      var1[0] = com.aspose.cells.b.a.b.zo.a();
      var2[0] = com.aspose.cells.b.a.b.zo.a();
      var3[0] = 0;
      var4[0] = 0;
      com.aspose.cells.b.a.a.zc var5 = com.aspose.cells.b.a.a.zf.a(var0);

      while(true) {
         com.aspose.cells.b.a.b.zo var6;
         do {
            if (!var5.c()) {
               return;
            }

            var6 = (com.aspose.cells.b.a.b.zo)var5.b();
            if (com.aspose.cells.b.a.b.zo.a(var1[0], com.aspose.cells.b.a.b.zo.a()) || var6.d() > var1[0].d()) {
               var1[0] = var6;
               var3[0] = (Integer)var5.a();
            }
         } while(!com.aspose.cells.b.a.b.zo.a(var2[0], com.aspose.cells.b.a.b.zo.a()) && var6.d() >= var2[0].d());

         var2[0] = var6;
         var4[0] = (Integer)var5.a();
      }
   }

   static void a(zn var0, zje var1, int var2, int var3, HashMap var4) {
      if (var3 > var2) {
         var2 += 360;
      }

      com.aspose.cells.b.a.b.zo[] var5 = new com.aspose.cells.b.a.b.zo[Math.abs(var2 - var3 + 1)];
      zbuk.a(var5);
      int var6 = 0;

      for(int var7 = var3; var7 <= var2; ++var7) {
         var5[var6] = (com.aspose.cells.b.a.b.zo)var4.get(var7 % 360);
         ++var6;
      }

      com.aspose.cells.b.a.b.a.ze var8 = new com.aspose.cells.b.a.b.a.ze();
      var8.c(var5);
      var1.k().a(var8);
   }
}
